Repository navigation
Commit f671dc1
committed
feature: ngx_http_lua_ffi_ssl_set_ciphers().
Sets the connection's TLS <= 1.2 cipher list and/or TLS 1.3 ciphersuites
from ssl_client_hello_by_lua*, e.g. keyed on the client hello server name.
Both strings are validated on a scratch SSL_CTX before being applied to
the connection, because a failed SSL_set_cipher_list() still installs the
parsed list on the connection (emptying the TLS <= 1.2 list on unknown
tokens) and leaves the thread error queue dirty, which makes
SSL_do_handshake() report failure after the callback returns.
The guarantee: if ngx_http_lua_ffi_ssl_set_ciphers returns NGX_ERROR for
an invalid ciphers and/or ciphersuites string, the connection's SSL
object is left exactly as it was -- cipher list, ciphersuites, and thread
error queue all untouched -- so the handshake proceeds with whatever the
connection already had, which is the default list inherited from the
vhost's SSL_CTX (ssl_ciphers/ssl_conf_command).
See openssl/openssl#7759 for the check-after-
install behaviour of SSL_set_cipher_list() and
https://docs.openssl.org/3.0/man3/SSL_get_error/ for the empty-queue
requirement.1 parent bbed32a commit f671dc1
1 file changed
Lines changed: 81 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
841 | 922 | | |
0 commit comments