Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 752
BaronRandom Avatar asked Jun 14 '26 23:06

BaronRandom


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()
like image 187
Vicks Loma Avatar answered Jun 17 '26 13:06

Vicks Loma



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!