Skip to content

Commit 1b17a08

Browse files
authored
Merge pull request #112 from lucawimmer/fix-opensslv1.0.2-ecdhe
Fix ECDH support for OpenSSL < 1.1.0
2 parents d022b09 + 8845892 commit 1b17a08

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libsofia-sip-ua/tport/tport_tls.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,21 @@ int tls_init_context(tls_t *tls, tls_issues_t const *ti)
434434
SSL_CTX_set_verify_depth(tls->ctx, ti->verify_depth);
435435
SSL_CTX_set_verify(tls->ctx, verify, tls_verify_cb);
436436
#ifndef OPENSSL_NO_EC
437+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
438+
if (tls_init_ecdh_curve(tls) == 0) {
439+
SU_DEBUG_3(("%s\n", "tls: initialized ECDH"));
440+
} else {
441+
SU_DEBUG_3(("%s\n", "tls: failed to initialize ECDH"));
442+
}
443+
#else
437444
if (tls->accept == 0) {
438445
SU_DEBUG_3(("%s\n", "tls: initialized ECDH"));
439446
} else if (tls_init_ecdh_curve(tls) == 0) {
440447
SU_DEBUG_3(("%s\n", "tls: initialized ECDH"));
441448
} else {
442449
SU_DEBUG_3(("%s\n", "tls: failed to initialize ECDH"));
443450
}
451+
#endif
444452
#endif
445453
if (!SSL_CTX_set_cipher_list(tls->ctx, ti->ciphers)) {
446454
SU_DEBUG_1(("%s: error setting cipher list\n", "tls_init_context"));

0 commit comments

Comments
 (0)