简体   繁体   English

如何在命令中获取* .cer文件以添加自签名HTTPS证书

[英]How to get a *.cer file to add a self-signed HTTPS certificate in command

It is related to the this question: How to get a *.cer file to add a self-signed HTTPS certificate as trusted for Java 它与以下问题有关: 如何获取* .cer文件以将自签名HTTPS证书添加为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? 我想知道是否可以通过命令获取.cer文件,以便使流程自动化?

In order to interact with a server over SSL, one of the well known tools is OpenSSL . 为了通过SSL与服务器进行交互, OpenSSL是一种众所周知的工具。 You can install it easily on your Linux or Windows. 您可以轻松地在Linux或Windows上安装它。 The OpenSSL has commands which could be used to retrieve SSL certificate of a server. OpenSSL具有可用于检索服务器的SSL证书的命令。

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) 请看以下有关通过OpenSSL检索服务器证书的分步教程的帖子(请特别注意注释,以使整个过程自动化)

Quickpost: Retrieving an SSL Certificate 快速发布:检索SSL证书

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM