I have a file with the '.pfx' extension and a password to this certificate.
What I need to do is to send a simple GET request to a webservice and read the response body.
I need to implement a method similar to this:
String getHttpResponse(String url, String certificateFile, String passwordToCertificate){
...
}
I also tried converting the certificate to a format "with no password" using openssl:
Convert a PKCS#12 file (.pfx .p12) containing a private key and certificates to PEM:
openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes
So the alternate implementaion of the my method could be:
String getHttpResponse(String url, String certificateFile){
...
}
I would really appreciate your help, I spent half a day googling for it, but I haven't found an example that would help me, it seems I have problems with undestanding some basic assumptions around SSL and stuff.