openresty / openresty

High Performance Web Platform Based on Nginx and LuaJIT

Home Page:https://openresty.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenResty 什么时候可以支持国密SSL呀?

opsarno opened this issue · comments

目前网安要求一些公司做国密合规,但又感觉国密现在不怎么成熟,唉,OpenResty 什么时候提供国密能力呀? 我司一直用的 OpenResty ,不想换其它的 WEB SEREVER。

============== 分割线 ==============

问题补充:
默认RPM安装的OpenResty,我看应该是支持SM2协议的

OpenResty 版本

$ openresty -V
nginx version: openresty/1.21.4.3
built by gcc 11.3.1 20221121 (Red Hat 11.3.1-4) (GCC)
built with OpenSSL 1.1.1s  1 Nov 2022
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl111/include' --add-module=../ngx_devel_kit-0.3.2 --add-module=../echo-nginx-module-0.63 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.33 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.09 --add-module=../srcache-nginx-module-0.33 --add-module=../ngx_lua-0.10.25 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.34 --add-module=../array-var-nginx-module-0.06 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.9 --add-module=../ngx_stream_lua-0.0.13 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl111/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl111/lib' --with-cc='ccache gcc -fdiagnostics-color=always' --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --with-compat --with-stream --with-http_ssl_module

Openssl 协议

$ /usr/local/openresty/openssl111/bin/openssl ecparam -list_curves|grep SM
  SM2       : SM2 curve over a 256 bit prime field

但是使用 cersign 签发的免费证书验证国密 测试会报错

$ /usr/local/openresty/bin/openresty -t
nginx: [emerg] SSL_CTX_use_certificate("/usr/local/openresty/nginx/ssl/wild.mydomain.cn_sm2_sign.crt") failed (SSL: error:140AB18E:SSL routines:SSL_CTX_use_certificate:ca md too weak)
nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed

使用证书签发机构提供的Nginx国密支持模块+Nginx 编译安装后,验证则通过。

你可以给一下 证书签发机构提供的 Nginx 国密支持模块吗?

你可以给一下 证书签发机构提供的 Nginx 国密支持模块吗?

如果你要验证国密功能的话,可以从 CerSign 申请免费证书
https://www.cersign.com/free-ssl-certificate.html

对应的国密算法模块参见
https://dl.zotrus.com/

根据文档编译安装验证即可。

使用tongsuo支持国密已经成功,需要修改nginx代码,https://www.yuque.com/tsdoc/ts/xy1vvzogtycvh4ob