Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls_openssl: only verify client certs if configured to require them #3281

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 4 additions & 9 deletions modules/tls_openssl/openssl_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,10 @@ static void get_ssl_ctx_verify_mode(struct tls_domain *d, int *verify_mode)
* SSL_VERIFY_PEER.
*/

if( d->verify_cert ) {
*verify_mode = SSL_VERIFY_PEER;
if( d->require_client_cert ) {
LM_INFO("client verification activated. Client "
"certificates are mandatory.\n");
*verify_mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
} else
LM_INFO("client verification activated. Client "
"certificates are NOT mandatory.\n");
if( d->require_client_cert ) {
LM_INFO("client verification activated. Client "
"certificates are mandatory.\n");
*verify_mode = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
} else {
*verify_mode = SSL_VERIFY_NONE;
LM_INFO("client verification NOT activated. Weaker security.\n");
Expand Down