During the development of a Java webservice client I ran into a problem. Authentication for the webservice is using a client certificate, a username and a password. The client certificate I received from the company behind the webservice is in .cer format.
I know we can do the above steps as shown in pic, but my question is tools like postman or soapUi automatically takes care of this steps. so, I want to implement the same in my java code.
Can some give me code to download .cer file using java code

I have built in the past an utility class which can do this. The usage is basically:
The library is available here: GitHub: SSLContext-kickstart You can add it to your maven project with: