File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -936,7 +936,19 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf,
936
936
if (result )
937
937
return result ;
938
938
}
939
- if (ssl_config -> key_passwd ) {
939
+ if (ssl_config -> cert_type && strcasecompare (ssl_config -> cert_type , "P12" )) {
940
+ rc = gnutls_certificate_set_x509_simple_pkcs12_file (
941
+ gtls -> shared_creds -> creds , config -> clientcert , GNUTLS_X509_FMT_DER ,
942
+ ssl_config -> key_passwd ? ssl_config -> key_passwd : "" );
943
+ if (rc != GNUTLS_E_SUCCESS ) {
944
+ failf (data ,
945
+ "error reading X.509 potentially-encrypted key or certificate "
946
+ "file: %s" ,
947
+ gnutls_strerror (rc ));
948
+ return CURLE_SSL_CONNECT_ERROR ;
949
+ }
950
+ }
951
+ else if (ssl_config -> key_passwd ) {
940
952
const unsigned int supported_key_encryption_algorithms =
941
953
GNUTLS_PKCS_USE_PKCS12_3DES | GNUTLS_PKCS_USE_PKCS12_ARCFOUR |
942
954
GNUTLS_PKCS_USE_PKCS12_RC2_40 | GNUTLS_PKCS_USE_PBES2_3DES |
You can’t perform that action at this time.
0 commit comments