drbild / sslpsk

Adds TLS-PSK support to the Python ssl package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how should key be specified

il023109 opened this issue · comments

What if the key is not a string but 4 bytes of data, like 0x12345678

How can I specify the key in client side.

PSKS = {'server1' : '1234',
'server2' : '0x1a2b3c4d'}

Just use standard Python binary strings:

PSKS = {'server1': 'mystring',
        'server2': b'\x1a\x2b\3cx\4d'}

perfect, it works fine with my embedded server side now.

Thanks, great testing tool!

You're welcome!