Skip to content

Commit 4cf27c6

Browse files
committed
tls: openssl: Fail verification if client certificate is not provided
Signed-off-by: Edward Lancaster <[email protected]>
1 parent c88c545 commit 4cf27c6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tls/openssl.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,11 @@ static void *tls_context_create(int verify,
801801
SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_NONE, NULL);
802802
}
803803
else {
804-
SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_PEER, NULL);
804+
int verify_flags = SSL_VERIFY_PEER;
805+
if (mode == FLB_TLS_SERVER_MODE) {
806+
verify_flags |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
807+
}
808+
SSL_CTX_set_verify(ssl_ctx, verify_flags, NULL);
805809
}
806810

807811
/* ca_path | ca_file */

0 commit comments

Comments
 (0)