How to add pkcs12 client certificate in Postman Chrome, W7?

I am trying to test a "strange" GET request in which I have to provide BASIC authentication and a client-side certificate.

I am trying to verify this using Postman Chrome, but I do not understand how to associate the certificate from the chrome personal certificate with my request.

I saw this discussion: https://github.com/a85/POSTMan-Chrome-Extension/issues/482 , but this is about the MAC key store, and I cannot port it to W7 / Chrome.

Here is my Java code that should do the same job as the postman to help you understand what I want the postman to do. We use this post to write it.

        InputStream is = context.getResources().getAssets().open("CertificateFile.p12");
        KeyStore keyStore = KeyStore.getInstance("PKCS12");
        BufferedInputStream bis = new BufferedInputStream(is);
        String password ="xxxxx";
        keyStore.load(bis, password.toCharArray()); // password is the PKCS#12 password. If there is no password, just pass null
        // Init SSL Context
        KeyManagerFactory kmf = KeyManagerFactory.getInstance("X509");
        kmf.init(keyStore, password.toCharArray());
        KeyManager[] keyManagers = kmf.getKeyManagers();
        SSLContext sslContext = SSLContext.getInstance("TLS");
        sslContext.init(keyManagers, null, null);
        HttpsURLConnection urlConnection = null; 
        String strURL = "theUrlITryToHit";
        url = new URL(strURL);
        urlConnection = (HttpsURLConnection) url.openConnection();
        if(urlConnection instanceof HttpsURLConnection) {
            ((HttpsURLConnection)urlConnection)
            .setSSLSocketFactory(sslContext.getSocketFactory());
        }
        urlConnection.setRequestMethod("GET");
        String basicAuth = "Basic " + Base64.encodeToString("pseudo:password".getBytes(), Base64.NO_WRAP);
        urlConnection.setRequestProperty ("Authorization", basicAuth);
+6
2

, . .pem, , Windows. :

openssl pkcs12 -inkey mycertandkey.pem -in mycert.crt -export -out mycertandkey.pfx

Linux, Windows, openssl.

certmgr.msc Windows. "" " " → "..." .pfx. "".

Chrome. Postman . URL-, . URL- .

+3

Mac, , , . CURL , , CURL:

curl --insecure --cert-type P12 --cert /path-to/your-file.p12:the-password https://your-host.com/endpoint

:

Postman->preferences->General
SSL certificate verification OFF

:

Postman->preferences->Certificates
Client Certificates:


Host yourhost.com
CRT file
Key file
PFX file  /path-to-file/CertificateFile.p12  
Passphrase your-file-password
0

All Articles