@@ -147,6 +147,8 @@ static int http_schannel_check_revoke_mode =
147
147
*/
148
148
static int http_schannel_use_ssl_cainfo ;
149
149
150
+ static int http_auto_client_cert ;
151
+
150
152
size_t fread_buffer (char * ptr , size_t eltsize , size_t nmemb , void * buffer_ )
151
153
{
152
154
size_t size = eltsize * nmemb ;
@@ -311,6 +313,11 @@ static int http_options(const char *var, const char *value, void *cb)
311
313
return 0 ;
312
314
}
313
315
316
+ if (!strcmp ("http.sslautoclientcert" , var )) {
317
+ http_auto_client_cert = git_config_bool (var , value );
318
+ return 0 ;
319
+ }
320
+
314
321
if (!strcmp ("http.minsessions" , var )) {
315
322
min_curl_sessions = git_config_int (var , value );
316
323
if (min_curl_sessions > 1 )
@@ -821,13 +828,24 @@ static CURL *get_curl_handle(void)
821
828
}
822
829
#endif
823
830
824
- if (http_ssl_backend && !strcmp ("schannel" , http_ssl_backend ) &&
825
- http_schannel_check_revoke_mode ) {
831
+ if (http_ssl_backend && !strcmp ("schannel" , http_ssl_backend )) {
832
+ long ssl_options = 0 ;
833
+ if (http_schannel_check_revoke_mode ) {
826
834
#if LIBCURL_VERSION_NUM >= 0x072c00
827
- curl_easy_setopt ( result , CURLOPT_SSL_OPTIONS , http_schannel_check_revoke_mode ) ;
835
+ ssl_options |= http_schannel_check_revoke_mode ;
828
836
#else
829
- warning (_ ("CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0" ));
837
+ warning (_ ("CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0" ));
830
838
#endif
839
+ }
840
+
841
+ if (http_auto_client_cert ) {
842
+ #if LIBCURL_VERSION_NUM >= 0x074d00
843
+ ssl_options |= CURLSSLOPT_AUTO_CLIENT_CERT ;
844
+ #endif
845
+ }
846
+
847
+ if (ssl_options )
848
+ curl_easy_setopt (result , CURLOPT_SSL_OPTIONS , ssl_options );
831
849
}
832
850
833
851
if (http_proactive_auth )
0 commit comments