如何创建自签名SSL证书以在测试Web应用程序时使用

时间:2022-06-02 00:13:08

How do I create a self signed SSL certificate for an Apache Server to use while testing a web app?

如何为Apache服务器创建自签名SSL证书,以便在测试Web应用程序时使用?

3 个解决方案

#1


28  

How do I create a self-signed SSL Certificate for testing purposes?

如何为测试目的创建自签名SSL证书?

from http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#selfcert:

  1. Make sure OpenSSL is installed and in your PATH.

    确保已安装OpenSSL并在PATH中。

  2. Run the following command, to create server.key and server.crt files:

    运行以下命令,创建server.key和server.crt文件:

    openssl req -new -x509 -nodes -out server.crt -keyout server.key
    

    These can be used as follows in your httpd.conf file:

    这些可以在httpd.conf文件中使用如下:

    SSLCertificateFile    /path/to/this/server.crt
    SSLCertificateKeyFile /path/to/this/server.key
    
  3. It is important that you are aware that this server.key does not have any passphrase. To add a passphrase to the key, you should run the following command, and enter & verify the passphrase as requested.

    请务必注意,此server.key没有任何密码短语。要为密钥添加密码,您应该运行以下命令,然后根据请求输入并验证密码。

    openssl rsa -des3 -in server.key -out server.key.new
    mv server.key.new server.key
    

    Please backup the server.key file, and the passphrase you entered, in a secure location.

    请在安全的位置备份server.key文件和您输入的密码。

#2


0  

Various tools exist that can generate SSLs. Try OpenSSL for example. Alternatively, there's one in the IIS 6 resource kit, if you're on Windows.

存在可以生成SSL的各种工具。以OpenSSL为例。或者,如果您使用的是Windows,那么IIS 6资源工具包中就有一个。

#3


-1  

Use OpenSSL (http://www.openssl.org/)

使用OpenSSL(http://www.openssl.org/)

Here's a tutorial: http://novosial.org/openssl/self-signed/

这是一个教程:http://novosial.org/openssl/self-signed/

Here is the good tutorial to start with: SSH localhost.

这是一个很好的教程:SSH localhost。

#1


28  

How do I create a self-signed SSL Certificate for testing purposes?

如何为测试目的创建自签名SSL证书?

from http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#selfcert:

  1. Make sure OpenSSL is installed and in your PATH.

    确保已安装OpenSSL并在PATH中。

  2. Run the following command, to create server.key and server.crt files:

    运行以下命令,创建server.key和server.crt文件:

    openssl req -new -x509 -nodes -out server.crt -keyout server.key
    

    These can be used as follows in your httpd.conf file:

    这些可以在httpd.conf文件中使用如下:

    SSLCertificateFile    /path/to/this/server.crt
    SSLCertificateKeyFile /path/to/this/server.key
    
  3. It is important that you are aware that this server.key does not have any passphrase. To add a passphrase to the key, you should run the following command, and enter & verify the passphrase as requested.

    请务必注意,此server.key没有任何密码短语。要为密钥添加密码,您应该运行以下命令,然后根据请求输入并验证密码。

    openssl rsa -des3 -in server.key -out server.key.new
    mv server.key.new server.key
    

    Please backup the server.key file, and the passphrase you entered, in a secure location.

    请在安全的位置备份server.key文件和您输入的密码。

#2


0  

Various tools exist that can generate SSLs. Try OpenSSL for example. Alternatively, there's one in the IIS 6 resource kit, if you're on Windows.

存在可以生成SSL的各种工具。以OpenSSL为例。或者,如果您使用的是Windows,那么IIS 6资源工具包中就有一个。

#3


-1  

Use OpenSSL (http://www.openssl.org/)

使用OpenSSL(http://www.openssl.org/)

Here's a tutorial: http://novosial.org/openssl/self-signed/

这是一个教程:http://novosial.org/openssl/self-signed/

Here is the good tutorial to start with: SSH localhost.

这是一个很好的教程:SSH localhost。