【发布时间】:2019-10-30 03:19:24
【问题描述】:
我需要将 SSL 密钥保存在一个文件中,以便稍后通过 Wireshark 解密 TCP 数据包。 我该怎么办?
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import urllib2
import json
data={}
data_json = json.dumps(data, encoding='UTF-8', ensure_ascii=False)
requrl = "https://52.31.41.56/test" # look, the protocol is https
req = urllib2.Request(url=requrl, data=data_json)
req.add_header('Content-Type', 'application/json')
# how can I record the SSL keys in a file, for Wireshark decryption
rsp_fp = urllib2.urlopen(req)
rsp_data = rsp_fp.read()
print(rsp_data)
【问题讨论】:
标签: python-2.7 ssl urllib2 wireshark