-
Notifications
You must be signed in to change notification settings - Fork 0
DTLS EXCEPTION "Handshake timed out" vs "DTLS Handshake has failed" #87
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
Welcome back ;) Hmm, what happens in situation 2 though if you don't pass a |
If the pair Identity / PSK is wrong, client should stop trying if he is nice, or brute force if he is bad :-( I don't now the details of the handshake but in situation 1 the server seems to reply. In the second one the server does not and a client timeout occurs. Right ? |
Yeah, I think that is the case here :/ I need to double-check that as well, but I think the server does not respond in that situation for security reasons. Do you see any server response when using Wireshark, for example? |
See here: openssl/openssl#18738 This seems to be the intended behavior and using a timeout seems to be the only way to deal with that :/ |
However, I guess we could let |
Never dug so deep :-) but trying ... |
Actually I am comparing dtls2 client with the behavior of openssl s_client and it is consistent: Situation 1: Identity wrong, PSK correct
Situation 2: Identity correct, PSK wrong
So just in this case a timeout is thrown otherwise the client will be stuck there. I think it is OK, because when a client is revocated on my server both Identity and PSK are dropped. At the end a Or did I miss something ? |
OK so far so good, but coming back with a new point here. Actually what disturbs me is the fact that a Going back to the openssl behavior in this case. If server is disconnected (offline):
I think I got my missing point now. Is it possible to implement |
Sure, that sounds good. Could you post the |
Actually, here it should be also SocketException Connection refused to copy the behavior of openssl s_client -dtls that returns err:111
The command to run is:
`openssl s_client -dtls -psk _identity "identity" -psk "presharedkey" - cipher "..." -connect <server-ip>:<port>`
against a server that is down. This makes also sense. It is a socket problem, not a dtls.
…On Jul 16, 2023, 13:28, at 13:28, Jan Romann ***@***.***> wrote:
> I think I got my missing point now. Is it possible to implement
`ConnectionRefusedException` catching this `write:error=111` ?
Sure, that sounds good. Could you post the `openssl` command you used
to generate the output, though? That would make it a bit easier to
replicate, I guess.
--
Reply to this email directly or view it on GitHub:
#87 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Any news at this front ? |
Hi @Ifilehk, sorry for not getting back to you earlier :/ I will try to continue working on this issue and the others later this week, if you should find a potential fix in the code in the meantime, feel free to open a Pull Request by the way :) |
Back again :-)
Facing 2 situations where the exception should be the same for both, but is not:
DtlsHandshakeException: DTLS Handshake has failed
what is fineDtlsTimeoutException after 0:00:10.000000: Handshake timed out
what is not OK. Should be exception as in 1Actually the exception should be
DtlsHandshakeException: Wrong identity and PSK
Easy to fix ?
The text was updated successfully, but these errors were encountered: