这里有没有人有关于如何在我的本地开发机器上获取SSL的明确而详细的步骤?我在c:\ wamp上安装了最新版本的WAMP(2.2c).我在网上找到的说明在大多数情况下似乎已经过时,而且缺乏正确完成工作所需的细节.
小智 11
先决条件:通常不需要安装openssl(它与Wamp捆绑在一起).例如,Apache 2.4.9包含1.0.1g.
系统变量:
openssl文件夹结构:
在C:\ wamp\bin\apache\apache#.#.#\ conf中创建以下文件夹结构:
.. demoCA |-----certs |-----crl |-----newcerts |-----private
配置openssl.cnf:
创建证书:
从命令行浏览到C:\ wamp\bin\apache\apache#.#.#\ bin \并调用"openssl req -new -out cacert.csr -keyout cacert.pem".如果提示输入密码,之后输入DN信息,如下所示.
Loading 'screen' into random state - done Generating a 1024 bit RSA private key .......................++++++ ....++++++ writing new private key to 'cacert.pem' Enter PEM pass phrase: my_secret_pass Verifying - Enter PEM pass phrase: my_secret_pass `----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. `----- Country Name (2 letter code) []: State or Province Name (full name) []: Locality Name (eg, city) []: Organization Name (eg, company) []: Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []:local Email Address []: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: C:\wamp\bin\apache\apache2.4.9\bin>
在同一控制台窗口中,现在使用"openssl rsa -in cacert.pem -out cacert.key",如果要求输入先前输入的密码.
Enter pass phrase for cacert.pem: my_secret_pass writing RSA key
删除C:\ wamp\bin\apache\apache2.4.9\bin中的".rnd"文件
恭喜您现在是自签名证书的所有者!
我根据本网站放置了构建的文件(它们当前位于bin文件夹中):
在httpd.conf中启用SLL(搜索"#Include conf/extra/httpd-ssl.conf")+更改httpd-ssl.conf中的以下条目:
SSLSessionCache "shmcb:C:/wamp/logs/ssl_scache(512000)"
DocumentRoot "C:/wamp/www"
#ErrorLog
#TransferLog
SSLCertificateFile "C:/wamp/bin/apache/apache2.4.9/conf/demoCA/certs/cacert.cert"
SSLCertificateKeyFile "C:/wamp/bin/apache/apache2.4.9/conf/demoCA/private/cacert.key"
CustomLog "C:/wamp/logs/ssl_request.log" \
Run Code Online (Sandbox Code Playgroud)
现在通过调用httpd -t来测试Apache安装.如果您收到以下错误"SSLSessionCache:'shmcb'会话缓存不受支持(已知名称:).也许您需要加载适当的socache模块(mod_socache_shmcb?)." 在httpd.conf中启用以下条目"LoadModule socache_shmcb_module modules/mod_socache_shmcb.so"
Wamp现在配置了https支持:-)
我还使用httpd.conf中的以下配置启用了"LoadModule status_module modules/mod_status.so":
<IfModule status_module>
ExtendedStatus On
<Location /server-status>
SetHandler server-status
</Location>
</IfModule>
Run Code Online (Sandbox Code Playgroud)
您现在可以在此检查您的服务器状态
https://localhost/server-status/
Run Code Online (Sandbox Code Playgroud)
Apache/2.4.9(Win64)OpenSSL/1.0.1g PHP/5.5.12服务器在localhost端口443
备注:
小智 8
我安装了WAMP 2.2E.
我遇到了同样的问题,经过大约一个小时的搜索互联网并尝试各种各样的事情后,我偶然发现openssl可以通过以下方式启用:
| 归档时间: |
|
| 查看次数: |
21583 次 |
| 最近记录: |