-
Couldn't load subscription status.
- Fork 2.7k
feat: support host level dynamic setting of tls protocol version #9903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
541ce66
76ba44b
9f3438c
be8a5ba
5d385be
759181d
c0bba54
92e74d1
4f9bf96
478e1b8
8f5c302
5c07708
313c5d2
69b834e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,13 +206,35 @@ function _M.match_and_set(api_ctx, match_only, alt_sni) | |
| end | ||
| end | ||
|
|
||
| local matched_ssl = api_ctx.matched_ssl | ||
| core.log.info("debug - matched: ", core.json.delay_encode(matched_ssl, true)) | ||
| core.log.info("debug - matched: ", core.json.delay_encode(api_ctx.matched_ssl, true)) | ||
|
|
||
| if match_only then | ||
| return true | ||
| end | ||
|
|
||
| ok, err = _M.set(api_ctx.matched_ssl, sni) | ||
| if not ok then | ||
| return false, err | ||
| end | ||
|
|
||
| return true | ||
| end | ||
|
|
||
|
|
||
| function _M.set(matched_ssl, sni) | ||
| if not matched_ssl then | ||
| return false, "failed to match ssl certificate" | ||
| end | ||
| local ok, err | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unused var There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 242 has. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| if not sni then | ||
| sni, err = apisix_ssl.server_name() | ||
| if type(sni) ~= "string" then | ||
| local advise = "please check if the client requests via IP or uses an outdated " .. | ||
| "protocol. If you need to report an issue, " .. | ||
| "provide a packet capture file of the TLS handshake." | ||
| return false, "failed to find SNI: " .. (err or advise) | ||
| end | ||
| end | ||
| ngx_ssl.clear_certs() | ||
|
|
||
| local new_ssl_value = secret.fetch_secrets(matched_ssl.value) or matched_ssl.value | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -367,6 +367,10 @@ | |
| { | ||
| "type": "doc", | ||
| "id": "profile" | ||
| }, | ||
| { | ||
| "type": "doc", | ||
| "id": "ssl-protocol" | ||
| } | ||
| ] | ||
| }, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.