ssl: Fix bug while use wolfssl

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
Jianhui Zhao
2020-01-31 15:00:37 +08:00
parent e6cdf0bae8
commit 59bc14aafb
+3 -1
View File
@@ -99,7 +99,7 @@ int rtty_ssl_init(struct rtty_ssl_ctx **ctx, int sock, const char *host)
c->net.fd = sock;
#else
#if UHTTPD_HAVE_WOLFSSL
#if RTTY_HAVE_WOLFSSL
wolfSSL_Init();
c->ctx = SSL_CTX_new(TLSv1_2_client_method());
@@ -113,7 +113,9 @@ int rtty_ssl_init(struct rtty_ssl_ctx **ctx, int sock, const char *host)
#endif
SSL_CTX_set_verify(c->ctx, SSL_VERIFY_NONE, NULL);
c->ssl = SSL_new(c->ctx);
#if RTTY_HAVE_OPENSSL
SSL_set_tlsext_host_name(c->ssl, host);
#endif
SSL_set_fd(c->ssl, sock);
#endif