Exporting a SSL certificate can be a rather challenging if you are a mac user since the browsers such as chrome does not provide that option. Instead you can only view the certificate. This is the work around I found. command - echo -n | openssl s_client -connect www.linkedin.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /Users/dinukshakandasamanage/Documents/$SERVERNAME.cert echo -n gives a response to the server, so that the connection is released. This will save the certificate to /Users/dinukshakandasamanage/Documents/$SERVERNAME.cert. You can define the path you want the certificate to be saved. sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' will extract only the necessary content that is preferred by the key stores.