Skip to content
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

Carry SNI while doing SSL handshaking with upstream #2988

Closed
tokers opened this issue Dec 8, 2020 · 9 comments · Fixed by #3420
Closed

Carry SNI while doing SSL handshaking with upstream #2988

tokers opened this issue Dec 8, 2020 · 9 comments · Fixed by #3420
Assignees
Labels
good first issue Good for newcomers

Comments

@tokers
Copy link
Contributor

tokers commented Dec 8, 2020

So far we don't enable the SNI extension when communicating with upstream. If upstream server depends on SNI to select proper certificate, then the TLS/SSL handshaking will fail. So we should carry the SNI extension.

Nginx has a directive named proxy_ssl_server_name.

Syntax: proxy_ssl_server_name on | off;
proxy_ssl_server_name off;
http, server, location

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.

So we can add this directive into apisix/cli/ngx_tpl.lua.

@tokers tokers added the good first issue Good for newcomers label Dec 8, 2020
@tokers tokers self-assigned this Dec 10, 2020
@membphis
Copy link
Member

add proxy_ssl_server_name on to apisix/cli/ngx_tpl.lua, should be fine.

welcome anyone to submit PR, fix this issue

@whitehatboxer
Copy link

Feel cool to fix this issue since I am not familiar with apisix so I think it will take some time to learn it first.

@tokers tokers assigned whitehatboxer and unassigned tokers Dec 10, 2020
@tokers
Copy link
Contributor Author

tokers commented Dec 10, 2020

@unbeatablekb Assigned to you and feel free to ask any questions here.

@membphis
Copy link
Member

Feel cool to fix this issue since I am not familiar with apisix so I think it will take some time to learn it first.

this is very cool ^_^

@whitehatboxer
Copy link

I have open a pr about this issue (as we can see above). Considered this functionality was guaranteed by Nginx and we just need to test the functionality of the generation of template which were already in testcases, I didn't add testcase of it.

@tokers
Copy link
Contributor Author

tokers commented Dec 21, 2020

@unbeatablekb No, we should add cases to verify it.

@whitehatboxer
Copy link

I agree with it. But I think it is hard to verify the changes because we can't verify things happened in tls.

@spacewander
Copy link
Member

spacewander commented Jan 26, 2021

@tokers @unbeatablekb
Use proxy_ssl_server_name on is not enough. The SNI sent to the backend is always apisix_backend.
We need to use proxy_ssl_name $host together.

@tokers
Copy link
Contributor Author

tokers commented Jan 26, 2021

@spacewander OK, it's required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
4 participants