forked from webserver-llc/angie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NTLS (short for 'National Security'), is a term used to refer to various Chinese security-related standards: - ShangMi (SM) Cipher Suites for TLS 1.3 (RFC 8998) (aka SM2,3,4) [1] - TLCP protocol (2020) [2] - GM/T 0024 "SSL VPN Technical Specifications" (2012) Related algorithms are implemented in the TongSuo library [3], fork of the OpenSSL. API is documented in [4]. The notable feature of NTLS is that the digital certificate used in the TLS protocol is divided into two types of certificates for encryption and signature, thus feature is often referred as "dual certificates". This patch allows Angie to use dual certificates exploiting SM2,3,4 features and enable NTLS for SSL connections. The patch adds server-side support to the ngx_http_ssl_module and client-side support to the ngx_http_proxy_module. The ssl_certificate, ssl_certificate_key and their proxy_ counterparts directives now accept two arguments instead of one: sign and encryption parts of certificate/key. The functionality must be enabled with "ssl_ntls" and/or "proxy_ssl_ntls" directives. Example configuration: listen ... ssl; ssl_ntls on; # dual NTLS certificate ssl_certificate sign.crt enc.crt; ssl_certificate_key sign.key enc.key; # can be combined with regular RSA certificate: ssl_certificate rsa.crt; ssl_certificate rsa.key; location /proxy { proxy_ssl_ntls on; proxy_ssl_certificate sign.crt enc.crt; proxy_ssl_certificate_key sign.key enc.key; proxy_ssl_ciphers "ECC-SM2-WITH-SM4-SM3:ECDHE-SM2-WITH-SM4-SM3:RSA"; proxy_pass https://backend:443; } Build Angie using the '--with-ntls' configure option and link with NTLS-enabled SSL library: ./configure --with-openssl=../Tongsuo-8.3.0 \ --with-openssl-opt=enable-ntls \ --with-ntls [1] https://datatracker.ietf.org/doc/html/rfc8998 [2] https://www.chinesestandard.net/PDF/English.aspx/GBT38636-2020 [3] https://github.com/Tongsuo-Project/Tongsuo [4] https://babassl.readthedocs.io/zh/latest/Tutorial/SM/ntls/
- Loading branch information
Showing
12 changed files
with
957 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.