@@ -179,6 +179,8 @@ static int http_schannel_check_revoke_mode =
179
179
*/
180
180
static int http_schannel_use_ssl_cainfo ;
181
181
182
+ static int http_auto_client_cert ;
183
+
182
184
size_t fread_buffer (char * ptr , size_t eltsize , size_t nmemb , void * buffer_ )
183
185
{
184
186
size_t size = eltsize * nmemb ;
@@ -357,6 +359,11 @@ static int http_options(const char *var, const char *value, void *cb)
357
359
return 0 ;
358
360
}
359
361
362
+ if (!strcmp ("http.sslautoclientcert" , var )) {
363
+ http_auto_client_cert = git_config_bool (var , value );
364
+ return 0 ;
365
+ }
366
+
360
367
if (!strcmp ("http.minsessions" , var )) {
361
368
min_curl_sessions = git_config_int (var , value );
362
369
#ifndef USE_CURL_MULTI
@@ -920,13 +927,24 @@ static CURL *get_curl_handle(void)
920
927
}
921
928
#endif
922
929
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 ) {
925
933
#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 ;
927
935
#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" ));
929
937
#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 );
930
948
}
931
949
932
950
if (http_proactive_auth )
0 commit comments