How do i catch a SSL/TLS key using python sockets on server side

Viewed 180

The client makes a GET request on some websites, like https://www.youtube.com. This request is redirected to my proxy server, which gets all of the data. Then i try to decode('UTF-8') it, but i get error

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 8: invalid start byte

I suppose this is because of SSL/TLS encryption? But then there is a question ---> How do I catch an SSL/TLS key using python sockets?

1 Answers

This error is because there are non-ASCII characters and that can't be encoded or decoded. There is one way to avoid this is to use the encode() function. Let your string is x

x.encode('utf-8').strip()
Related