Permalink
Browse files

print out ssl errors to stdout before exploding

  • Loading branch information...
tmm1 committed Sep 1, 2011
1 parent 5222bcd commit 8f911327e248eefff7410954df447d4901cb0867
Showing with 5 additions and 0 deletions.
  1. +5 −0 ext/ssl.cpp
View
@@ -159,11 +159,14 @@ SslContext_t::SslContext_t (bool is_server, const string &privkeyfile, const str
e = SSL_CTX_use_PrivateKey_file (pCtx, privkeyfile.c_str(), SSL_FILETYPE_PEM);
else
e = SSL_CTX_use_PrivateKey (pCtx, DefaultPrivateKey);
+ if (e <= 0) ERR_print_errors_fp(stderr);
assert (e > 0);
+
if (certchainfile.length() > 0)
e = SSL_CTX_use_certificate_chain_file (pCtx, certchainfile.c_str());
else
e = SSL_CTX_use_certificate (pCtx, DefaultCertificate);
+ if (e <= 0) ERR_print_errors_fp(stderr);
assert (e > 0);
}
@@ -177,10 +180,12 @@ SslContext_t::SslContext_t (bool is_server, const string &privkeyfile, const str
int e;
if (privkeyfile.length() > 0) {
e = SSL_CTX_use_PrivateKey_file (pCtx, privkeyfile.c_str(), SSL_FILETYPE_PEM);
+ if (e <= 0) ERR_print_errors_fp(stderr);
assert (e > 0);
}
if (certchainfile.length() > 0) {
e = SSL_CTX_use_certificate_chain_file (pCtx, certchainfile.c_str());
+ if (e <= 0) ERR_print_errors_fp(stderr);
assert (e > 0);
}
}

0 comments on commit 8f91132

Please sign in to comment.