defensive-coding-guide/modules/ROOT/pages/_partials/snippets/Features-TLS-Client-OpenSSL-Connection-Use.adoc
2018-09-20 11:51:33 +02:00

11 lines
271 B
Text

const char *const req = "GET / HTTP/1.0\r\n\r\n";
if (SSL_write(ssl, req, strlen(req)) < 0) {
ssl_print_error_and_exit(ssl, "SSL_write", ret);
}
char buf[4096];
ret = SSL_read(ssl, buf, sizeof(buf));
if (ret < 0) {
ssl_print_error_and_exit(ssl, "SSL_read", ret);
}