如何创建到使用自签名证书在测试一个Web应用程序 [英] How do I create a self signed SSL certificate to use while testing a web app

查看:244
本文介绍了如何创建到使用自签名证书在测试一个Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建一个自签名SSL证书的Apache服务器在测试一个web应用程序使用?


解决方案

  

如何创建一个自签名的SSL
  证书用于测试目的?


从<一个href=\"http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#selfcert\">http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#selfcert:


  1. 确保已安装OpenSSL和在路径中。


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

      OpenSSL的REQ -new -x509 -nodes退房手续server.crt -keyout server.key

    这可以作为你的httpd.conf文件如下:

     了SSLCertificateFile /path/to/this/server.crt
    了SSLCertificateKeyFile /path/to/this/server.key


  3. 这你都知道,这server.key没有任何密码是很重要的。要将密码添加到钥匙,你应该运行下面的命令,然后输入与放大器;验证密码的要求。

      OpenSSL的RSA -des3 -in server.key -out server.key.new
    MV server.key.new server.key

    请备份server.key文件,并且你输入的密码,
    在安全的位置。


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

解决方案

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

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

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

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

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

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

    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.

    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.

这篇关于如何创建到使用自签名证书在测试一个Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆