先生成网关证书 ,仿照CA模式
1 生成私钥,需要密码的
openssl genrsa -des3 -out server.key 1024
2 生成证书请求
openssl req -new -key server.key -out server.csr
3 生成证书
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -day 365 -in server.csr -signkey server.key -out server.crt
1 生成私钥,需要密码的
openssl genrsa -des3 -out server.key 1024
2 生成证书请求
openssl req -new -key server.key -out server.csr
3 生成证书
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -day 365 -in server.csr -signkey server.key -out server.crt
配置文件
# HTTPS server
server {
listen 444;
server_name localhost;
server {
listen 444;
server_name localhost;
ssl on;
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
root html;
index index.html index.htm;
}