drbild / sslpsk

Adds TLS-PSK support to the Python ssl package
Apache License 2.0
25 stars 32 forks source link

how should key be specified #4

Closed il023109 closed 6 years ago

il023109 commented 6 years ago

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'}

drbild commented 6 years ago

Just use standard Python binary strings:

PSKS = {'server1': 'mystring',
        'server2': b'\x1a\x2b\3cx\4d'}
il023109 commented 6 years ago

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

Thanks, great testing tool!

drbild commented 6 years ago

You're welcome!