-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: add proxy_ssl_server_name #3084
feat: add proxy_ssl_server_name #3084
Conversation
conf/config-default.yaml
Outdated
@@ -174,6 +174,8 @@ nginx_config: # config for render the template to generate n | |||
# lua_shared_dicts: # add custom shared cache to nginx.conf | |||
# ipc_shared_dict: 100m # custom shared cache, format: `cache-key: cache-size` | |||
|
|||
proxy_ssl_server_name: false # disable passing of the server name through tls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be enabled by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
conf/config-default.yaml
Outdated
@@ -174,6 +174,8 @@ nginx_config: # config for render the template to generate n | |||
# lua_shared_dicts: # add custom shared cache to nginx.conf | |||
# ipc_shared_dict: 100m # custom shared cache, format: `cache-key: cache-size` | |||
|
|||
proxy_ssl_server_name: true # disable passing of the server name through tls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is not right. Just reference the Nginx doc:
Enables or disables passing of the server name through TLS Server Name Indication extension (SNI, RFC 6066) when establishing a connection with the proxied HTTPS server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already replace it.
@unbeatablekb Should have test cases for it, you can prepare a keypair that the SNI is not matched with the backend server and assert the proxy is aborted. |
@tokers Thanks for giving help. I will add test for it after learning nginx test which would be done within this weeks. |
@unbeatablekb apisix/t/plugin/proxy-rewrite.t Lines 258 to 308 in b78c87a
|
@spacewander Thanks for your advice. I will do it. |
@tokers @spacewander Finally I add test cases in |
if you need any help, please let us know |
@unbeatablekb CI failed. |
t/APISIX.pm
Outdated
@@ -384,6 +384,24 @@ _EOC_ | |||
} | |||
} | |||
|
|||
server { | |||
listen 1985 ssl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this. We already have a HTTPS backend:
Line 444 in 3db8ebe
listen 1983 ssl; |
You just need to pass a wrong host header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tokers @spacewander The I already pushed the code and details of the output of running test are show blow. |
GET /hello | ||
--- error_code: 502 | ||
--- error_log | ||
ssl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how you assert the 502 is due to SSL handshaking failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
Only enable proxy_ssl_server_name doesn't pass the correct SNI to the backend. I have submitted a new one to surpass this PR: #3420 @unbeatablekb |
What this PR does / why we need it:
fix: #2988
Pre-submission checklist: