rbit / pydtls

Datagram Transport Layer Security for Python
Apache License 2.0
72 stars 45 forks source link

Will this work for Hue Entertainment #20

Open mariusmotea opened 6 years ago

mariusmotea commented 6 years ago

Hi,

I want to know if this library can be used in my project for emulating the Hue Entertainment future. My project is build in Python 3 and the requirements for Hue Entertainment are these:

DTLS Handshaking UDP port 2100 is used for DTLS handshaking and streaming. Only DTLS mode version 1.2 with Pre-Shared Key (PSK) Key exchange method with TLS_PSK_WITH_AES_128_GCM_SHA256 set as Cipher Suite is supported.

Thanks.

kershner commented 6 years ago

I am also attempting to use pydtls to get up and running with Hue Entertainment. No luck so far (because I'm not super knowledgeable with sockets just yet) but I believe it will be possible because pydtls does support DTLS version 1.2 according to the readme.

You'll likely also need to use this sslpsk library in order to create a socket connection using PSKs.

mariusmotea commented 6 years ago

@kershner please let me know if you made any progress. Thanks, Marius.

lijia00 commented 6 years ago

seems like there is some problem when running the server side with cipher=PSK. It seems to work fine on the client side, as it requests the PSK cipher suite successfully. I started a conversation regarding this in a separate post. For Hue entertainment are you the client or server?

lijia00 commented 6 years ago

Actually when setting cipher="PSK" I only see these 3 being requested in wireshark it doesn't have the one you need with GCM_SHA256 Cipher Suite: TLS_PSK_WITH_AES_256_CBC_SHA (0x008d) Cipher Suite: TLS_PSK_WITH_AES_128_CBC_SHA (0x008c) Cipher Suite: TLS_PSK_WITH_3DES_EDE_CBC_SHA (0x008b)

mariusmotea commented 6 years ago

Hi,

For Hue entertainment are you the client or server?

i'm the server. Can you share the server code you tried?

Thanks.