Replies: 2 comments
-
You can already specify a different hostname for the purpose of connecting: endpoint = Async::HTTP::Endpoint.parse("https://mysite.local", hostname: "192.168.1.1")
# => #<Async::HTTP::Endpoint https://mysite.local/ {hostname: "192.168.1.1"}>
endpoint.endpoint
# => #<IO::Endpoint::SSLEndpoint endpoint=#<IO::Endpoint::HostEndpoint name="192.168.1.1" service=443 family=nil type=1 protocol=nil flags=nil>>
endpoint.endpoint.hostname
# => "mysite.local" There is the URL hostname for the purpose of TLS, and the endpoint hostname for the purpose of connecting. Is that what you are after? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes, thank you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sometimes it's useful to open a TLS-encrypted connection to a given hostname using with a given (user-specified) IP address.
For example, I've observed round-robin DNS being used to load balance authentication servers. But if one or more host is down, clients can get intermittent connection errors. An LDAPS client could connect to an IP address for a known working host, but it would still need to be aware of the hostname (for TLS certificate validation).
Similarly, when using HTTPS, one might use one client for each resolved IP address for a given host, for reasons such as load balancing, maximizing throughput, etc.
I needed this capability, so I monkey-patched
Async::HTTP::Endpoint
to add an:ip_address
option and it seems to work: main...wtn:async-http:ip_addrWould this feature be more appropriately implemented in
IO::Endpoint
?Beta Was this translation helpful? Give feedback.
All reactions