TASSL-1.1.1k icon indicating copy to clipboard operation
TASSL-1.1.1k copied to clipboard

如何配置nginx使用国密连接上游服务器?

Open zhouyujie1231 opened this issue 2 years ago • 2 comments

我的配置: location / { # 连接上游的证书路径 proxy_ssl_certificate /var/zyjjj/certs/CS.crt; proxy_ssl_certificate_key /var/zyjjj/certs/CS.key; # proxy_ssl_certificate /var/zyjjj/certs/CE.crt; # proxy_ssl_certificate_key /var/zyjjj/certs/CE.key;

    # 验证服务器证书
    proxy_ssl_verify on;
    proxy_ssl_trusted_certificate /var/zyjjj/certs/CA.crt;
    # 设置验证深度
    proxy_ssl_verify_depth 2;

    include common/ngswaf_lua_empty_hook.conf;
    resolver 114.114.114.114 8.8.8.8;
    # proxy_pass $up_server;
    proxy_pass https://10.90.2.55:4433/;
}

以上证书都是国密证书,如此配置抓包发现还是使用的TLS1.2去握手,并且握手过程中没有国密套件,导致与服务器ssl握手失败

zhouyujie1231 avatar Sep 15 '22 14:09 zhouyujie1231

好像标准nginx没办法直接这个库作为客户端连接国密服务器

zhouyujie1231 avatar Sep 16 '22 08:09 zhouyujie1231

不支持标准nginx作为国密ssl客户端,需要使用改造过的版本https://github.com/jntass/Nginx_Tassl

增加proxy_ssl_gm on;配置

yanshichao0226 avatar Sep 23 '22 07:09 yanshichao0226