Skip to content

Commit

Permalink
Check for SSL_CTX_set_default_verify_paths return code.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 9f282b9c8ea7290588d45e310e667c05742041e9
  • Loading branch information
levlam committed Aug 29, 2018
1 parent 8079285 commit cb165ad
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tdnet/td/net/SslStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,15 @@ class SslStreamImpl {
} else {
LOG(ERROR) << "Failed to open system certificate store";
}

#else
SSL_CTX_set_default_verify_paths(ssl_ctx);
if (SSL_CTX_set_default_verify_paths(ssl_ctx) == 0) {
auto error = create_openssl_error(-8, "Failed to load default verify paths");
if (verify_peer == VerifyPeer::On) {
return error;
} else {
LOG(ERROR) << error;
}
}
#endif
} else {
if (SSL_CTX_load_verify_locations(ssl_ctx, cert_file.c_str(), nullptr) == 0) {
Expand Down

0 comments on commit cb165ad

Please sign in to comment.