Skip to content

Commit

Permalink
tls: better log messages when failing to create ssl ctx
Browse files Browse the repository at this point in the history
(cherry picked from commit d2906da)
(cherry picked from commit 7b24119)
  • Loading branch information
miconda committed Jul 16, 2020
1 parent 244e6e3 commit 24a5582
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/modules/tls/tls_domain.c
Expand Up @@ -1026,7 +1026,11 @@ static int ksr_tls_fix_domain(tls_domain_t* d, tls_domain_t* def)
d->ctx[i] = SSL_CTX_new((SSL_METHOD*)ssl_methods[d->method - 1]);
}
if (d->ctx[i] == NULL) {
ERR("%s: Cannot create SSL context\n", tls_domain_str(d));
unsigned long e = 0;
e = ERR_peek_last_error();
ERR("%s: Cannot create SSL context [%d] (%lu: %s / %s)\n",
tls_domain_str(d), i, e, ERR_error_string(e, NULL),
ERR_reason_error_string(e));
return -1;
}
if(d->method>TLS_USE_TLSvRANGE) {
Expand All @@ -1036,7 +1040,11 @@ static int ksr_tls_fix_domain(tls_domain_t* d, tls_domain_t* def)
/* libssl >= 1.1.0 */
d->ctx[i] = SSL_CTX_new(sr_tls_methods[d->method - 1].TLSMethod);
if (d->ctx[i] == NULL) {
ERR("%s: Cannot create SSL context\n", tls_domain_str(d));
unsigned long e = 0;
e = ERR_peek_last_error();
ERR("%s: Cannot create SSL context [%d] (%lu: %s / %s)\n",
tls_domain_str(d), i, e, ERR_error_string(e, NULL),
ERR_reason_error_string(e));
return -1;
}
if(d->method>TLS_USE_TLSvRANGE) {
Expand Down

0 comments on commit 24a5582

Please sign in to comment.