It is related to the this question: How to get a *.cer file to add a self-signed HTTPS certificate as trusted for Java
As mentioned in the answer:
With firefox is is done by double-clicking on the lock in the status bar, clicking on the button "View certificate", then in the "Details" tab, click on "Export..."
I am wondering if there is anyway to get the .cer file in command, so that I can get the process automated?
In order to interact with a server over SSL, one of the well known tools is OpenSSL
. You can install it easily on your Linux or Windows. The OpenSSL has commands which could be used to retrieve SSL certificate of a server.
Take a look at the below post for step by step tutorial on retrieving server certificate through OpenSSL (pay special attention to comments in order to automate the overall process)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.