加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – nginx proxy ssl clr“400 bad request”错误

发布时间:2020-12-13 16:50:18 所属栏目:Linux 来源:网络整理
导读:这是情况 – 有一个透明的nginx代理处理SSL证书,并且在我们决定添加撤销列表管理之前做得很好,出于安全原因需要.这是“ssl_crl”行开始播放并搞砸所有内容的时候. server { listen 80; rewrite ^ https://$host$request_uri permanent;}server { listen 443
这是情况 – 有一个透明的nginx代理处理SSL证书,并且在我们决定添加撤销列表管理之前做得很好,出于安全原因需要.这是“ssl_crl”行开始播放并搞砸所有内容的时候.
server {
    listen  80;
    rewrite ^ https://$host$request_uri permanent;
}


server {
    listen 443 ssl;
    server_name example.com;
    ssl on;
    ssl_certificate /home/netadmin/keys/tid.crt;
    ssl_certificate_key /home/netadmin/keys/tid.key;
    ssl_session_cache shared:SSL:10m;
    ssl_client_certificate /home/netadmin/keys/personchain.pem;
    ssl_crl /home/netadmin/keys/personlist.crl;
    ssl_verify_client on;
    ssl_verify_depth 2;
    error_log /var/log/nginx/debug.log debug;

    location / {
            proxy_pass      http://111.111.111.111:80;
    }

每当用户尝试使用SSL进行身份验证时,服务器将始终提供“400 Bad Request”错误.
请注意,完全相似(因为语法不同)配置在Apache中完美运行.
现在证书是完美的,已经多次证明,例如这里的验证检查

openssl crl -CAfile personchain.pem -inform PEM -in personlist.crl -lastupdate -nextupdate -noout
verify OK
lastUpdate=Apr 22 14:59:18 2013 GMT 
nextUpdate=Apr 29 14:59:18 2013 GMT

CRL链接正在运行,没有什么看起来不对,这是一段错误日志.

2013/04/23 15:47:42 [info] 3612#0: *1 client SSL certificate verify error: (3:unable to get certificate CRL) while reading client request headers,client: 192.168.122.1,server: example.com,request: "GET / HTTP/1.1",host: "example.com"

这基本上是唯一的错误,正如我之前所说,相同的证书可以与Apache一起使用.
我认为这可能是一个错误,但类似错误的最后一个通知是2011年,所以我怀疑还没有人解决这个难题.

解决方法

答案如下: https://serverfault.com/a/676498/277052:
如果您有多个CA,则必须连接所有CRL.

You have to concatenate all the CRL in chain: Root CA and Intermediate CAs.

Using openssl crl -in crl_list.crl -noout -text only read the first crl,but nginx reads them correctly and validate the user certificate.

Inspired by: 07001

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读