Skip to content

Fix compilation without deprecated OpenSSL 1.1 APIs. #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/nopoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,11 @@ void nopoll_cleanup_library (void)
{

if (__nopoll_tls_was_init) {
#if OPENSSL_VERSION_NUMBER < 0x10100000L
EVP_cleanup ();
CRYPTO_cleanup_all_ex_data ();
ERR_free_strings ();
#endif

/* notify the library isn't initialized */
__nopoll_tls_was_init = nopoll_false;
Expand Down
8 changes: 8 additions & 0 deletions src/nopoll_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,9 @@ noPollConn * nopoll_conn_tls_new (noPollCtx * ctx,
/* init ssl ciphers and engines */
if (! __nopoll_tls_was_init) {
__nopoll_tls_was_init = nopoll_true;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_library_init ();
#endif
} /* end if */

/* call common implementation */
Expand Down Expand Up @@ -1426,7 +1428,9 @@ noPollConn * nopoll_conn_tls_new6 (noPollCtx * ctx,
/* init ssl ciphers and engines */
if (! __nopoll_tls_was_init) {
__nopoll_tls_was_init = nopoll_true;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_library_init ();
#endif
} /* end if */

/* call common implementation */
Expand Down Expand Up @@ -1495,7 +1499,9 @@ noPollConn * nopoll_conn_tls_new_with_socket (noPollCtx * ctx,
/* init ssl ciphers and engines */
if (! __nopoll_tls_was_init) {
__nopoll_tls_was_init = nopoll_true;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_library_init ();
#endif
} /* end if */

/* call common implementation */
Expand Down Expand Up @@ -4755,7 +4761,9 @@ nopoll_bool __nopoll_conn_accept_complete_common (noPollCtx * ctx, noPollConnOpt
/* init ssl ciphers and engines */
if (! __nopoll_tls_was_init) {
__nopoll_tls_was_init = nopoll_true;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_library_init ();
#endif
} /* end if */

/* now configure chainCertificate */
Expand Down
6 changes: 2 additions & 4 deletions src/nopoll_decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,20 +511,18 @@ typedef enum {
* established with this method will only understand this
* method.
*/
NOPOLL_METHOD_TLSV1_1 = 5
NOPOLL_METHOD_TLSV1_1 = 5,
#endif
#if defined(NOPOLL_HAVE_TLSv12_ENABLED)
,
/**
* @brief Allows to define TLSv1.2 as SSL protocol used by the
* client or server connection. A connection/listener
* established with this method will only understand this
* method.
*/
NOPOLL_METHOD_TLSV1_2 = 6
NOPOLL_METHOD_TLSV1_2 = 6,
#endif
#if defined(NOPOLL_HAVE_TLS_FLEXIBLE_ENABLED)
,
/**
* @brief Allows to define TLS flexible negotiation where the
* highest version available will be negotiated by both
Expand Down