drbild / sslpsk

Adds TLS-PSK support to the Python ssl package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

server hint empty sent

rpablos opened this issue · comments

There is an issue with server hint and some clients will not work properly.
If you don't specify a server hint, the server hint should not be sent. But in the code what you specify finally is a zero-length bytes object, so you get the hint sent with length equals to zero.

What I did for not changing the c source is:

-In sslpsk.py, in function _ssl_set_psk_server_callback, change
_ = _sslpsk.sslpsk_use_psk_identity_hint(_sslobj(sock), hint if hint else b"")
for

 if hint:
        _      = _sslpsk.sslpsk_use_psk_identity_hint(_sslobj(sock), hint)

regards