Skip to content
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

Handshake with IKEA Trådfri gateway fails due to resume state #2

Open
eriklupander opened this issue Mar 4, 2019 · 2 comments
Open

Comments

@eriklupander
Copy link

Hi!

I tried to use your splendid DTLS library when trying to talk to my IKEA Trådfri Gateway. However, I couldn't get the handshake to complete. After a bit of debugging, I discovered that the session resume check on session_handshake.go#361 was returning true during the handshake, which resulted in ClientKeyExchange never being sent to the Gateway.

After commenting out the !s.resumed check, the handshake completes just fine and subsequent data transfer works as expected. Regrettably, I'm not knowledgable enough of DTLS and handshakes to try to find the issue and create a proper Pull Request. Sorry.

Note that I 've been able to connect to at least one other CoAP-server running DTLS without my little fix so I honestly have no idea whether it's an issue with how the IKEA Gateway works or if there's something quirky with the handshake.

Anyway - just wanted to let you know.

Thanks!

@bocajim
Copy link
Collaborator

bocajim commented Mar 5, 2019 via email

@eriklupander
Copy link
Author

Thanks!
I'm not familiar with tcpdump, but I recorded three successful handshakes (running my fork that has the session resume commented out).

I've attached three files:

Log output (debug level) from the library during a completed handshake.
handshake-log.txt

Tcpdump to the console using -vv and -X flags:
handshake-dump-console.txt

Tcpdump to disk using -vv and -X flags
handshake-dump.txt

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants