[GH-ISSUE #2070] is there a way to set connect on the tls streams? #873

Open
opened 2026-03-16 00:42:10 +03:00 by kerem · 3 comments
Owner

Originally created by @ibigbug on GitHub (Oct 18, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2070

firstly congrats on the rebranding!

then back to the topic,

in particular to calling tls_client_connect_with_bind_addr

it seems to be returning a future and the connection is established from background.

and client::AsyncClient::with_timeout only sets timeout for query req/res it seems.

so can we set timeout on the stream connection, which is useful to fail early if the remote server is timeout?

Originally created by @ibigbug on GitHub (Oct 18, 2023). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2070 firstly congrats on the rebranding! then back to the topic, in particular to calling `tls_client_connect_with_bind_addr` it seems to be returning a future and the connection is established from background. and `client::AsyncClient::with_timeout` only sets timeout for query req/res it seems. so can we set timeout on the stream connection, which is useful to fail early if the remote server is timeout?
Author
Owner

@bluejekyll commented on GitHub (Oct 18, 2023):

I think these are related: #2050, it seems that we have timeout missing as an option on a few of these tls based interfaces.

<!-- gh-comment-id:1769189259 --> @bluejekyll commented on GitHub (Oct 18, 2023): I think these are related: #2050, it seems that we have `timeout` missing as an option on a few of these tls based interfaces.
Author
Owner

@ibigbug commented on GitHub (Oct 19, 2023):

right. would like to see that happen or help where i can

<!-- gh-comment-id:1771010030 --> @ibigbug commented on GitHub (Oct 19, 2023): right. would like to see that happen or help where i can
Author
Owner

@marcbrevoort-cyberhive commented on GitHub (Nov 3, 2023):

I think these are related: #2050, it seems that we have timeout missing as an option on a few of these tls based interfaces.

I've briefly looked at getting this in. I feel it would make sense to get it added to the ClientConnection trait but soon found out the interface for h2_client_connection doesn't look quite like that of tcp_client_connection.

Sure, I can add a parameter timeout: Option<std::time::Duration> to new_stream in ClientConnection, and run cargo check - but if I do so, while I'll get warnings about timeout missing in tcp_client_connection and udp_client_connection, but not in the new_stream implementation under impl<T> ClientConnection for HttpsClientConnection<T>, even though it's not in there. I'm sure the authors have a (much) more solid understanding of how to get this timeout thing going than I do.

<!-- gh-comment-id:1792601813 --> @marcbrevoort-cyberhive commented on GitHub (Nov 3, 2023): > I think these are related: #2050, it seems that we have `timeout` missing as an option on a few of these tls based interfaces. I've briefly looked at getting this in. I feel it would make sense to get it added to the ClientConnection trait but soon found out the interface for `h2_client_connection` doesn't look quite like that of `tcp_client_connection`. Sure, I can add a parameter `timeout: Option<std::time::Duration>` to `new_stream` in `ClientConnection`, and run `cargo check` - but if I do so, while I'll get warnings about `timeout` missing in `tcp_client_connection` and `udp_client_connection`, but not in the `new_stream` implementation under `impl<T> ClientConnection for HttpsClientConnection<T>`, even though it's not in there. I'm sure the authors have a (much) more solid understanding of how to get this timeout thing going than I do.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#873
No description provided.