File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1076,6 +1076,15 @@ static int rd_kafka_ssl_cert_callback(SSL *ssl, void *arg) {
10761076 X509 * cert ;
10771077 int i ;
10781078
1079+ /* Get client cert from SSL connection */
1080+ cert = SSL_get_certificate (ssl );
1081+ if (cert == NULL ) {
1082+ /* If there's no client certificate,
1083+ * skip certificate issuer verification and
1084+ * avoid logging a warning. */
1085+ return 1 ;
1086+ }
1087+
10791088 /* Get the accepted client CA list from the SSL connection, this
10801089 * comes from the `certificate_authorities` field. */
10811090 ca_list = SSL_get_client_CA_list (ssl );
@@ -1088,10 +1097,7 @@ static int rd_kafka_ssl_cert_callback(SSL *ssl, void *arg) {
10881097 return 1 ;
10891098 }
10901099
1091- /* Get client cert from SSL connection */
1092- cert = SSL_get_certificate (ssl );
1093-
1094- if (cert != NULL && rd_kafka_ssl_cert_issuer_match (ca_list , cert )) {
1100+ if (rd_kafka_ssl_cert_issuer_match (ca_list , cert )) {
10951101 /* A match is found, use the certificate. */
10961102 return 1 ;
10971103 }
You can’t perform that action at this time.
0 commit comments