I am trying to get the certificate of a remote server, which I can then use to add to my keystore and use within my Java application. A senior dev (who is on holidays :( ) informed me I can run this: openssl s_client -connect host.host:9999 to get a raw certificate dumped out, which I can then copy and export. I receive the following output: depth=1 /C=NZ/ST=Test State or Province/O=Organization N