@@ -162,6 +162,8 @@ static long http_schannel_check_revoke_mode =
162162 */
163163static int http_schannel_use_ssl_cainfo ;
164164
165+ static int http_auto_client_cert ;
166+
165167static int always_auth_proactively (void )
166168{
167169 return http_proactive_auth != PROACTIVE_AUTH_NONE &&
@@ -450,6 +452,11 @@ static int http_options(const char *var, const char *value,
450452 return 0 ;
451453 }
452454
455+ if (!strcmp ("http.sslautoclientcert" , var )) {
456+ http_auto_client_cert = git_config_bool (var , value );
457+ return 0 ;
458+ }
459+
453460 if (!strcmp ("http.minsessions" , var )) {
454461 min_curl_sessions = git_config_int (var , value , ctx -> kvi );
455462 if (min_curl_sessions > 1 )
@@ -1074,9 +1081,20 @@ static CURL *get_curl_handle(void)
10741081 }
10751082#endif
10761083
1077- if (http_ssl_backend && !strcmp ("schannel" , http_ssl_backend ) &&
1078- http_schannel_check_revoke_mode ) {
1079- curl_easy_setopt (result , CURLOPT_SSL_OPTIONS , http_schannel_check_revoke_mode );
1084+ if (http_ssl_backend && !strcmp ("schannel" , http_ssl_backend )) {
1085+ long ssl_options = 0 ;
1086+ if (http_schannel_check_revoke_mode ) {
1087+ ssl_options |= http_schannel_check_revoke_mode ;
1088+ }
1089+
1090+ if (http_auto_client_cert ) {
1091+ #ifdef GIT_CURL_HAVE_CURLSSLOPT_AUTO_CLIENT_CERT
1092+ ssl_options |= CURLSSLOPT_AUTO_CLIENT_CERT ;
1093+ #endif
1094+ }
1095+
1096+ if (ssl_options )
1097+ curl_easy_setopt (result , CURLOPT_SSL_OPTIONS , ssl_options );
10801098 }
10811099
10821100 if (http_proactive_auth != PROACTIVE_AUTH_NONE )
0 commit comments