-
Notifications
You must be signed in to change notification settings - Fork 75
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
Connecting to IoT fails with TLS negotiation timeout #119
Comments
Thanks for bringing this up. You're not the first person to run into this problem and timeouts are definitely on our radar to find/expose a better solution to. |
Is it very difficult to expose the timeout option to configurability? Also, even if the above not possible it would be nice to have the CRT error available to the java SDK. As it is this failure causes connect to fail with no description of the failure, so I had to enable the CRT log and look there. This would be a lot more difficult when the device was on the client's side. |
It's not difficult to expose a particular kind of timeout, but there is some internal debate over how we should be exposing them. I'm currently a fan of "one timeout across the full connection establishment regardless of what's going on underneath" which API-wise doesn't mesh with exposing individual timeouts for small pieces of the full circuit construction. For example, right now in the SDK you can configure a connection establishment request to:
Only when (3) completes successfully (or an error anywhere short circuits the process) will you, the user, get a callback. In that timeframe there's two separate tls timeouts, a socket timeout, two (CONNECT and websocket handshake) http request timeouts, and that's only counting things we can control (not the second half of the proxy CONNECT request). In the future, we may have even more complex patterns (primarily revolving around proxy authentication). From a user experience perspective, I'd much rather a single knob that meant "if my connection isn't fully established by this time, then give up" over 5+ knobs that all control little sub-pieces (that don't give complete cover) of timeout failures. |
I agree. As a user I want the least amount of complexity exposed to me,as
long as I can do my job. With that said at this point I'd like the fastest
solution possible since this SDK is already deployed on client sites and if
the network has high latency this particular feature, which is an important
one, won't work.
…On Thu, Dec 10, 2020 at 6:43 PM Bret Ambrose ***@***.***> wrote:
It's not difficult to expose a particular kind of timeout, but there is
some internal debate over how we should be exposing them. I'm currently a
fan of "one timeout across the full connection establishment regardless of
what's going on underneath" which API-wise doesn't mesh with exposing
individual timeouts for small pieces of the full circuit construction.
For example, right now in the SDK you can configure a connection
establishment request to:
1. Establish a tls-protected connection to a proxy
2. Establish a tls-protected end-to-end tunnel (completely independent
of the tls context in 1) through the proxy to an arbitrary endpoint via a
CONNECT request, in order to
3. Make an http request to perform a websocket upgrade on (2) in order
to use mqtt over the connection
Only when (3) completes successfully (or an error anywhere short circuits
the process) will you, the user, get a callback. In that timeframe there's
two separate tls timeouts, a socket timeout, two (CONNECT and websocket
handshake) http request timeouts, and that's only counting things we can
control (not the second half of the proxy CONNECT request).
From a user experience perspective, I'd much rather a single knob that
meant "if my connection isn't fully established by this time, then give up"
over 5+ knobs that all control little sub-pieces (that don't give complete
cover) of timeout failures.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALHS2PA7TQBDADQCAFR5Q3SUD3E3ANCNFSM4UTPWX5Q>
.
|
Just did a quick check and the default was recently raised to 10s from 4s. The latest version of the v2 sdk should have that default change. It's still not a configurable value, but updating to latest my temporarily ameliorate your issue until we get better timeout config implemented. |
Got it, thanks. Much appreciated. |
I upgraded to 1.2.10 and crt 0.9.2 and now the process crashes. I'm getting the following:
|
Are you on windows? |
In this case yes.
…On Tue, 22 Dec 2020, 17:25 Bret Ambrose, ***@***.***> wrote:
Are you on windows?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALHS2O664TINSW5N6CAZ73SWC25FANCNFSM4UTPWX5Q>
.
|
This should be fixed in v1.2.11 |
|
Is your feature request related to a problem? Please describe.
I'm trying to connect to IoT via a proxy to a broker in a region that's far from me. This fails with:
So basically if the network is slow or the latency high I won't be able to connect.
Describe the solution you'd like
TLS negotiation timeout is currently set to 4 seconds in the native layer. This is non-configurable. I'd like to be able to set it.
Describe alternatives you've considered
I can have a retry mechanism, but that won't work in a high latency setup.
Additional context
This feature request already exists in the python crt repo.
The text was updated successfully, but these errors were encountered: