python – Maniuplar ClientHello – Stack Overflow in Spanish

I am trying to do something but I do not know if it is possible since I do not have much knowledge about ssl.

The idea is that the versions prior to Python 2.7.9 do not have support for the Server Name Indication extension and I have thought about manipulating the ClientHello message data that Python sends to the server through an intermediate connection that captures that message and adds the extension to it. send to the server and forward the answer back to python.

In theory it seems to work fine, I check the ClientHello message with Wireshark and it seems to be correct and I recieve the ServerHello from the server but then I get the following error:

ssl.SSLError: [SSL: TLSV1_ALERT_DECRYPT_ERROR] tlsv1 alert decrypt error (_ssl.c: 726)

I would like to know if what I am trying to do is not possible, since in some way it is verified that the message has not been altered and then it will not work in any way.