-
Notifications
You must be signed in to change notification settings - Fork 997
feat(ssl options): support SNI hostname #1615
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
Conversation
The HTTPX gem supports this OpenSSL::SSL::SSLSocket#hostname= option
|
Sorry @bf4 I somehow missed this until now, taking a look now 👀 |
|
OK so a couple minor fixes are needed to make this ready to merge. I've found this old PR doing something similar that you can use as a guideline.
|
|
Thanks @iMacTia for the helpful reference PR. Pushed a new commit |
Thanks 😊 I should have done that 🤦 |
| # # | ||
| # # @!attribute hostname | ||
| # # @return [String] SNI hostname (see https://ruby.github.io/openssl/OpenSSL/SSL/SSLSocket.html#method-i-hostname-3D) | ||
| # # @return [String] Server hostname used for SNI (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLSocket.html#method-i-hostname-3D) |
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.
Hm, is that a very old Ruby docs link?
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.
Agreed.. was just being consistent within the file without expanding scope to change more.
The two files also use different docs paths.
I'm not surprised you noticed as well given how small the pr is
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.
Ahaha yeah the ciphers comment also points to 2.5.1! Definitely needs an update but agree we can do that in a follow-up PR 👍
The HTTPX gem supports this OpenSSL::SSL::SSLSocket#hostname= option
Description
The HTTPX gem supports the
ssloptionhostname=but, when using the Faraday adapter, it raises an errorThis option is defined as
OpenSSL::SSL::SSLSocket#hostnameand looks like it has been around a long time ruby/openssl#81I've found it helpful when using a SOCKS5 proxy and I want to set the hostname for use in verifying the certificate. Without this change, I need to set OpenSSL::SSL::VERIFY_NONE
Todos
Not sure if tests or documentation are needed
Additional Notes
Happy to make any changes needed.