Nginx不提供中间证书

时间:2014-08-03 21:34:19

标签: ssl nginx chain

我正在尝试在Nginx上安装ssl证书(实际上是laravel forge)。我已将证书与中间证连接起来,并且我在Nginx错误日志中没有收到任何错误。但是,它不受移动铬专用桌面的信任。

看看Qualys ssl测试,他们说连锁店是不完整的。我不知道怎么回事。

这是我的Nginx配置

server {
listen 80;
server_name **********.com;
return 301 https://**********.com$request_uri;
}

server {
listen 443 ssl;
server_name **********.com;
root /home/forge/**********.com/public;

# FORGE SSL (DO NOT REMOVE!)
ssl on;
ssl_certificate /etc/nginx/ssl/**********.com/1086/server.pem;
ssl_certificate_key /etc/nginx/ssl/**********.com/1086/server.key;

index index.html index.htm index.php;

charset utf-8;

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

access_log off;
error_log  /var/log/nginx/**********.com-error.log error;

error_page 404 /index.php;

location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
}

location ~ /\.ht {
    deny all;
}
}

任何人都可以帮忙吗?我已经把头发拉了好几天了。

1 个答案:

答案 0 :(得分:4)

  

看看Qualys ssl测试,它说链是不完整的。我不知道怎么样......

看起来你发错了中间人:

$ openssl s_client -connect cauterypens.com:443
CONNECTED(00000003)
depth=0 C = GB, OU = Domain Control Validated, CN = cauterypens.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 C = GB, OU = Domain Control Validated, CN = cauterypens.com
verify error:num=27:certificate not trusted
verify return:1
depth=0 C = GB, OU = Domain Control Validated, CN = cauterypens.com
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
 0 s:/C=GB/OU=Domain Control Validated/CN=cauterypens.com
   i:/C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2
 1 s:/O=AlphaSSL/CN=AlphaSSL CA - G2
   i:/C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA
 ...

证书0的主题是CN=cauterypens.com。证书0的颁发者是CN=AlphaSSL CA - SHA256 - G2

中间证书应该是链中的下一个。但是,您要发送CN=AlphaSSL CA - SHA256 - G2,而不是发送CN=AlphaSSL CA - G2。请注意名称中缺少SHA256

要解决此问题,您应该从Download GlobalSign Root and Intermediate Certificate获取AlphaSSL CA - SHA256 - G2。它有thumprint thumbprint ae:bf:32:c3:c8:32:c7:d7:bc:55:99:b1:aa:05:fb:6c:f4:d9:29:4c


相关:CA为CN=GlobalSign Root CA。这是GlobalSign Root R1下载。下载并将其保存到文件(名称为Root-R1.crt)。它已经在PEM编码中。然后,您应该能够通过以下方式验证链:

$ openssl s_client -connect cauterypens.com:443 -CAfile Root-R1.crt
...
Verify OK (0)

如果没有验证,那么你还有其他麻烦。在继续之前解决问题。