Skip to content

Commit

Permalink
ssl: Fix bug while use wolfssl
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
  • Loading branch information
zhaojh329 committed Jan 31, 2020
1 parent 92d1fa8 commit e84815e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int uwsc_ssl_init(struct uwsc_ssl_ctx **ctx, int sock, char *host)

c->net.fd = sock;
#else
#if UHTTPD_HAVE_WOLFSSL
#if UWSC_HAVE_WOLFSSL
wolfSSL_Init();

c->ctx = SSL_CTX_new(TLSv1_2_client_method());
Expand All @@ -113,7 +113,9 @@ int uwsc_ssl_init(struct uwsc_ssl_ctx **ctx, int sock, char *host)
#endif
SSL_CTX_set_verify(c->ctx, SSL_VERIFY_NONE, NULL);
c->ssl = SSL_new(c->ctx);
#if UWSC_HAVE_OPENSSL
SSL_set_tlsext_host_name(c->ssl, host);
#endif
SSL_set_fd(c->ssl, sock);
#endif

Expand Down

0 comments on commit e84815e

Please sign in to comment.