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

Issue when trying to use in conjunction with "sslpsk" library. #6

Closed
d8ahazard opened this issue Nov 2, 2019 · 2 comments
Closed

Comments

@d8ahazard
Copy link

I'm trying to implement dtls with psk to work with the hue entertainment API. Unfortunately, I'm having some issues, and I'm not quite sure if the problem is with dtls or sslpsk.

Also openend drbild/sslpsk#6

Process finished with exit code -1073741819 (0xC0000005)

def do_handshake(self):
    print("Handshaking with ", self.bridge_ip)
    ssl_sock = False
    psk = binascii.unhexlify(self.bridge_key)
    print("PSK", psk)
    try:
        do_patch()  # dtls library doing its thing
        print("Patched")
        host = self.bridge_ip
        port = 2100
        print("Wrapping socket")
        tcp_socket = socket(AF_INET, SOCK_DGRAM)
        tcp_socket.connect((host, port))
        ssl_sock = sslpsk.wrap_socket(tcp_socket,
                                      ssl_version=258,
                                      ciphers='PSK-AES128-GCM-SHA256',
                                      psk=psk, hint=self.user)
        print("Socket wrapped")

        msg = "ping"
        ssl_sock.sendall(msg.encode())
        msg = ssl_sock.recv(4).decode()
        print('Client received: %s' % msg)
    except Exception as e:
        print("Socket exception: ", e)
    return ssl_sock
@yulianoifa-mobius
Copy link

Hi
The code you have provided is not related to DTLS which is working over UDP. Your code is related to TCP.
You would need to view to code of both DTLS and SSLPSK libraries and modify SSLPSK according to RFC to support the UDP socket

@d8ahazard
Copy link
Author

Yeah, no. It's definitely for UDP. Hue streaming.

but, hey, I appreciate you taking a year to get back to me and being completely dismissive of my request. Have a good one!

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