Skip to content
Merged
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
18 changes: 8 additions & 10 deletions iocore/net/SSLClientUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,17 @@ SSLInitClientContext(const SSLConfigParams *params)
if (params->clientVerify) {
SSL_CTX_set_verify(client_ctx, SSL_VERIFY_PEER, verify_callback);
SSL_CTX_set_verify_depth(client_ctx, params->client_verify_depth);
}

if (params->clientCACertFilename != nullptr || params->clientCACertPath != nullptr) {
if (!SSL_CTX_load_verify_locations(client_ctx, params->clientCACertFilename, params->clientCACertPath)) {
SSLError("invalid client CA Certificate file (%s) or CA Certificate path (%s)", params->clientCACertFilename,
params->clientCACertPath);
goto fail;
}
}

if (!SSL_CTX_set_default_verify_paths(client_ctx)) {
SSLError("failed to set the default verify paths");
if (params->clientCACertFilename != nullptr || params->clientCACertPath != nullptr) {
if (!SSL_CTX_load_verify_locations(client_ctx, params->clientCACertFilename, params->clientCACertPath)) {
SSLError("invalid client CA Certificate file (%s) or CA Certificate path (%s)", params->clientCACertFilename,
params->clientCACertPath);
goto fail;
}
} else if (!SSL_CTX_set_default_verify_paths(client_ctx)) {
SSLError("failed to set the default verify paths");
goto fail;
}

if (SSLConfigParams::init_ssl_ctx_cb) {
Expand Down
7 changes: 0 additions & 7 deletions iocore/net/SSLNetVConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1013,13 +1013,6 @@ SSLNetVConnection::sslStartHandShake(int event, int &err)
SSLErrorVC(this, "failed to create SSL client session");
return EVENT_ERROR;
}
if (clientVerify && params->clientCACertFilename != nullptr && params->clientCACertPath != nullptr) {
if (!SSL_CTX_load_verify_locations(clientCTX, params->clientCACertFilename, params->clientCACertPath)) {
SSLError("invalid client CA Certificate file (%s) or CA Certificate path (%s)", params->clientCACertFilename,
params->clientCACertPath);
return EVENT_ERROR;
}
}

this->ssl = make_ssl_connection(clientCTX, this);
if (this->ssl == nullptr) {
Expand Down