defensive-coding-guide/modules/ROOT/examples/Features-TLS-Client-OpenSSL-Connection-Use.adoc
2022-01-13 20:42:40 +01: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);
}