问题描述
我接受了一个使用Laravel 4.2和PHP 5.6构建的项目。
并已使用Docker挂载了服务器。
服务器使用Nginx,即来自Let's Encrypt with Certbot的证书。 这些是Nginx的配置文件:
nginx.conf
server {
index index.php index.html;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/public;
server_name example.com.py www.example.com.py;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}
listen [::]:443 ssl http2 ipv6only=on; # managed by Cetbot
listen 443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com.py/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com.py/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
和 options-ssl-nginx.conf
# This file contains important security parameters. If you modify this file
# manually,Certbot will be unable to automatically provide future security
# updates. Instead,Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file.
ssl_session_cache shared:le_nginx_SSL:40m; #holds approx 40 x 4000 sessions
ssl_session_timeout 2h;
ssl_session_tickets off;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
该项目是与当地信用卡付款处理公司有关联的电子商务。
一切正常,直到“付款”处理程序响应我服务器中的URL以进行付款确认。
这是我的服务器在将请求发送到付款确认网址时对“付款处理程序”做出的响应:
[状态500]
OpenSSL :: SSL :: SSL错误:Receivedfatalalert:handshake_failure
我在laravel.log或nginx日志中没有任何错误或任何内容的日志。
我复制粘贴了相同的请求,并用 Postman 复制了该请求,返回正确的 200回复效果很好。
付款处理者告诉我,我只需要验证 TLS1.2 及更高版本的证书,就可以在我的 options-ssl-nginx.conf 文件中看到,多数民众赞成已通过验证。
有人知道什么可能会丢失吗?
预先感谢
更新1:
我提高了nginx错误日志的级别,并得到以下错误:
这是一个测试:
SSL_do_handshake() failed (SSL: error:1417A0C1:SSL routines:tls_post_process_client_hello:no shared cipher) while SSL handshaking,client: 190.128.218.209,server: 0.0.0.0:443
一个小时前我也得到了这个
SSL_do_handshake() failed (SSL: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol) while SSL handshaking,client: 3.236.110.87,server: 0.0.0.0:443
解决方法
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
您的密码设置非常严格,即RSA证书只有5个TLS 1.2密码(由于您可能不使用ECC证书,因此ECDSA密码可能无关紧要)。可能是付款处理公司使用的特定客户端既不支持这些TLS 1.2密码,也不支持TLS 1.3。
仅注释掉ssl_ciphers
行以使它退回到默认设置可能会很有用,默认设置通常(使用OpenSSL的当前版本)仍是安全的,但范围更广。