【发布时间】:2016-02-15 20:03:30
【问题描述】:
我有来自 RapidSSL GeoTrust Inc. 的有效证书。但是当我尝试从 Android 设备向我的服务器发送请求时,出现错误:
javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException:信任锚 找不到证书路径。
我在服务器上使用 nginx。如果我在浏览器中打开 url,它看起来还可以。如何使它适用于 Unity3d 的 Android 构建?
Nginx 配置:
server {
listen 443 ssl;
root /var/www/my_server.net;
server_name my_server.net;
index index.html index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~* \.(ico|jpg|jpeg|png|gif|swf|css|json|sd)$ {
try_files $uri =404;
access_log off;
expires 1m;
add_header Cache-Control "public";
}
ssl on;
ssl_certificate /var/cert.crt;
ssl_certificate_key /var/cert.key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "RC4:HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;
error_page 404 /404.json;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
【问题讨论】:
-
/var/cert.crt是否包含中间证书?