-
Notifications
You must be signed in to change notification settings - Fork 236
iroh-net: provide a way to supply custom TLS connection code for relay #2901
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
Comments
This would presumably also need to be enabled for the various HTTPS probes in netcheck?
|
also what about general DNS resolution of the relay urls, and in the discovery service? |
Does iroh resolve relay URLs without the intention to establish a connection to the relay? For the discovery service I don't know, Delta Chat has it disabled I think, but if it is some HTTPS endpoint accessed via TLS then it should also be possible to proxy it. For DHT I think it's fine if it tries to connect directly, worst case DHT does not work on corporate networks that require that users access the internet via SOCKS5 or HTTP CONNECT proxy. |
I don't know what captive portal check is for. If it is about public Wi-Fi captive portal, then why does iroh need to know about it? User has to open it in a browser anyway.
This should definitely use the same connection establishment code as actual relay connection code. |
I assume the reason you went for custom TLS setup code in favor of, say, using reqwest (given it supports SOCKS5, HTTP(s) proxies and DNS resolution customization), is that you want to also use this for IMAP and SMPT, right? I'm thinking through what it'd mean if we double-down on reqwest in iroh-net, so we get SOCKS5, HTTP(s) proxies, etc. all out of the box for all requests we make in iroh-net, and have them be configurable in one way. |
In Delta Chat we have all TCP connection established via single function: This ensures we use the same DNS resolution, same timeouts, etc. Using What I want is avoiding situation where some server is reachable over HTTPS, SMTP and IMAP, but connection to relay fails because DNS is down, timeouts are lower, IP addresses are tried in different order or not at all, TLS certificate is considered invalid while we have it in our certificate storage etc. |
Another example is Outline SDK, interface has a single function that gets a string like "iroh.example.org:1234" and returns a stream: Maybe also pass ALPN in, but if you only use HTTP/1.1 connections then it's not needed. Can always be added later with a breaking change if required. |
If you add QUIC and WebTransport for relay connection, this will of course change the needed API because there a single |
In Delta Chat we have custom code to setup TLS connections that supports built-in DNS cache and various types of proxies: SOCKS5, HTTP(S) proxies and Shadowsocks. This code is used for all IMAP, SMTP and HTTPS connections except for the connection to iroh relay. Because of this relay connection is less reliable, e.g. it will not work if DNS is down and it cannot work over Shadowsocks which is not supported by iroh-net.
If's fine for STUN and P2P QUIC connection to be outside of control for iroh-net library user, but for relay we need some way to provide custom code to establish TLS connections that can reuse existing DNS caches, certificate checking code and so on. iroh can then run HTTP stream on top of generic stream.
The text was updated successfully, but these errors were encountered: