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) {
1076
1076
X509 * cert ;
1077
1077
int i ;
1078
1078
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
+
1079
1088
/* Get the accepted client CA list from the SSL connection, this
1080
1089
* comes from the `certificate_authorities` field. */
1081
1090
ca_list = SSL_get_client_CA_list (ssl );
@@ -1088,10 +1097,7 @@ static int rd_kafka_ssl_cert_callback(SSL *ssl, void *arg) {
1088
1097
return 1 ;
1089
1098
}
1090
1099
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 )) {
1095
1101
/* A match is found, use the certificate. */
1096
1102
return 1 ;
1097
1103
}
You can’t perform that action at this time.
0 commit comments