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

Add support for client-side TLS "Server Name Indication" (SNI) #160

Closed
rlebeau opened this issue Apr 6, 2017 · 3 comments
Closed

Add support for client-side TLS "Server Name Indication" (SNI) #160

rlebeau opened this issue Apr 6, 2017 · 3 comments
Labels
Element: I/O Handlers Issues related to TIdIOHandler and descendants Element: SSL/TLS Issues related to SSL/TLS handling, TIdSSLIOHandlerSocketBase and descendants Status: Fixed Issue has been fixed, no further work needed Type: Enhancement Issue is proposing a new feature/enhancement
Milestone

Comments

@rlebeau
Copy link
Member

rlebeau commented Apr 6, 2017

http://en.wikipedia.org/wiki/Server_Name_Indication

Per http://stackoverflow.com/questions/5113333/:

On the client side, you use SSL_set_tlsext_host_name(ssl, servername) before initiating the SSL connection.

On the server side, it's a little more complicated:

  • Set up an additional SSL_CTX() for each different certificate;
  • Add a servername callback to each SSL_CTX() using SSL_CTX_set_tlsext_servername_callback();
  • In the callback, retrieve the client-supplied servername with SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name). Figure out the right SSL_CTX to go with that host name, then switch the SSL object to that SSL_CTX with SSL_set_SSL_CTX().

The s_client.c and s_server.c files in the apps/ directory of the OpenSSL source distribution implement this functionality, so they're a good resource to see how it should be done.

@rlebeau rlebeau added Type: Enhancement Issue is proposing a new feature/enhancement Element: I/O Handlers Issues related to TIdIOHandler and descendants Element: SSL/TLS Issues related to SSL/TLS handling, TIdSSLIOHandlerSocketBase and descendants labels Apr 6, 2017
@rlebeau rlebeau added this to the Indy 12 milestone Apr 6, 2017
@rlebeau
Copy link
Member Author

rlebeau commented Apr 6, 2017

Client-side support for calling SSL_set_tlsext_host_name() when making an outbound SSL connection has been added to TIdSSLIOHandlerSocketOpenSSL in SVN rev 5321. Server-side support when accepting an inbound SSL connection has not been implemented yet.

On the client side, if TIdSSLIOHandlerSocktOpenSSL connects to an SSL/TLS server through a proxy, it is using the proxy's hostname for SNI instead of using the target server's hostname. This needs to be fixed. UPDATE: Client-side support for SNI through a proxy was added in SVN rev 5360.

Server-side SNI is still not implemented at this time. Opening new ticket IndySockets/IndyTLS-OpenSSL#15 for that.

@HeartWareDK
Copy link

Any progress to report on Server-Side SNI ?

@rlebeau
Copy link
Member Author

rlebeau commented May 23, 2019

Nothing that has been checked in yet. Some code changes were submitted to me awhile back ago, and I have incorporated them into my private dev copy of Indy, but I haven't had time to test and verify that things work before checking in to the public repository. I have no ETA on that at this time.

@rlebeau rlebeau changed the title Add support for TLS "Server Name Indication" (SNI) Add client-side support for TLS "Server Name Indication" (SNI) Apr 25, 2023
@rlebeau rlebeau changed the title Add client-side support for TLS "Server Name Indication" (SNI) Add support for client-side TLS "Server Name Indication" (SNI) Apr 25, 2023
@rlebeau rlebeau added the Status: Fixed Issue has been fixed, no further work needed label Apr 25, 2023
@rlebeau rlebeau closed this as completed Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Element: I/O Handlers Issues related to TIdIOHandler and descendants Element: SSL/TLS Issues related to SSL/TLS handling, TIdSSLIOHandlerSocketBase and descendants Status: Fixed Issue has been fixed, no further work needed Type: Enhancement Issue is proposing a new feature/enhancement
Projects
None yet
Development

No branches or pull requests

2 participants