How to handle ssl connections in raw Python socket?

前端 未结 3 1906
执念已碎
执念已碎 2021-01-28 00:53

I\'m writing a program to download a given webpage. I need to only use raw python sockets for all the connection due to some restriction. So I make a socket connection to a give

3条回答
  •  面向向阳花
    2021-01-28 01:13

    I think the easier way to do that would be using SSL contexts and wraping the TCP socket.

    Python SSL module's documentation give a very thoroughful explanation with examples. I recommend you to read the relevant sections of Python 2 or Python 3 ssl module documentation. It should be very easy to achieve what you want.

    Hope this helps!

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题