Last active
September 7, 2016 06:05
-
-
Save eagleon/d9fafe46a510a04b0b08f4c4e0d45dea to your computer and use it in GitHub Desktop.
https改造:测试环境验证
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 安装openssl | |
2. 颁发证书给自己 | |
openssl genrsa -des3 -out server.key 1024 \\用于生成rsa私钥文件 | |
openssl req -new -key server.key -out server.csr \\openssl req 用于生成证书请求 | |
openssl rsa -in server.key -out server_nopwd.key \\利用openssl进行RSA为公钥加密 | |
openssl x509 -req -days 365 -in server.csr -signkey server_nopwd.key -out server.crt | |
3. 添加nginx证书 | |
server { | |
listen 443 ssl; | |
ssl on; | |
ssl_certificate /usr/local/nginx/ssl/server.crt; //证书路径,却对和相对路径都可以 | |
ssl_certificate_key /usr/local/nginx/ssl/server_nopwd.key; | |
} | |
nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:99 | |
是nginx编译的时候没有增加这个ssl模块,从新编译加上 --with-http_ssl_module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment