@@ -179,6 +179,8 @@ static int http_schannel_check_revoke_mode =
179179 */
180180static int http_schannel_use_ssl_cainfo ;
181181
182+ static int http_auto_client_cert ;
183+
182184size_t fread_buffer (char * ptr , size_t eltsize , size_t nmemb , void * buffer_ )
183185{
184186 size_t size = eltsize * nmemb ;
@@ -357,6 +359,11 @@ static int http_options(const char *var, const char *value, void *cb)
357359 return 0 ;
358360 }
359361
362+ if (!strcmp ("http.sslautoclientcert" , var )) {
363+ http_auto_client_cert = git_config_bool (var , value );
364+ return 0 ;
365+ }
366+
360367 if (!strcmp ("http.minsessions" , var )) {
361368 min_curl_sessions = git_config_int (var , value );
362369#ifndef USE_CURL_MULTI
@@ -920,13 +927,24 @@ static CURL *get_curl_handle(void)
920927 }
921928#endif
922929
923- if (http_ssl_backend && !strcmp ("schannel" , http_ssl_backend ) &&
924- http_schannel_check_revoke_mode ) {
930+ if (http_ssl_backend && !strcmp ("schannel" , http_ssl_backend )) {
931+ long ssl_options = 0 ;
932+ if (http_schannel_check_revoke_mode ) {
925933#if LIBCURL_VERSION_NUM >= 0x072c00
926- curl_easy_setopt ( result , CURLOPT_SSL_OPTIONS , http_schannel_check_revoke_mode ) ;
934+ ssl_options |= http_schannel_check_revoke_mode ;
927935#else
928- warning (_ ("CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0" ));
936+ warning (_ ("CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0" ));
929937#endif
938+ }
939+
940+ if (http_auto_client_cert ) {
941+ #if LIBCURL_VERSION_NUM >= 0x074d00
942+ ssl_options |= CURLSSLOPT_AUTO_CLIENT_CERT ;
943+ #endif
944+ }
945+
946+ if (ssl_options )
947+ curl_easy_setopt (result , CURLOPT_SSL_OPTIONS , ssl_options );
930948 }
931949
932950 if (http_proactive_auth )
0 commit comments