Skip to content

Commit

Permalink
Merge pull request #3 from neheb/patch-1
Browse files Browse the repository at this point in the history
ssl: Fix OpenSSL 1.1 compilation without deprecated APIs
  • Loading branch information
Jianhui Zhao authored Nov 27, 2018
2 parents dbd18b9 + fe433d9 commit 388e6d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,14 @@ int uwsc_ssl_init(struct uwsc_ssl_ctx **ctx, int sock)

c->net.fd = sock;
#else
#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_library_init();
SSL_load_error_strings();

c->ctx = SSL_CTX_new(SSLv23_client_method());
#else
c->ctx = SSL_CTX_new(TLS_client_method());
#endif
SSL_CTX_set_verify(c->ctx, SSL_VERIFY_NONE, NULL);

c->ssl = SSL_new(c->ctx);
Expand Down

0 comments on commit 388e6d4

Please sign in to comment.