mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
use open instead of file
This commit is contained in:
parent
6c1c6f5f0a
commit
f2db8abbe8
@ -75,13 +75,13 @@ class TServer(tcp.TCPServer):
|
|||||||
raw_cert = self.ssl.get(
|
raw_cert = self.ssl.get(
|
||||||
"cert",
|
"cert",
|
||||||
tutils.test_data.path("data/server.crt"))
|
tutils.test_data.path("data/server.crt"))
|
||||||
cert = certutils.SSLCert.from_pem(file(raw_cert, "rb").read())
|
cert = certutils.SSLCert.from_pem(open(raw_cert, "rb").read())
|
||||||
raw_key = self.ssl.get(
|
raw_key = self.ssl.get(
|
||||||
"key",
|
"key",
|
||||||
tutils.test_data.path("data/server.key"))
|
tutils.test_data.path("data/server.key"))
|
||||||
key = OpenSSL.crypto.load_privatekey(
|
key = OpenSSL.crypto.load_privatekey(
|
||||||
OpenSSL.crypto.FILETYPE_PEM,
|
OpenSSL.crypto.FILETYPE_PEM,
|
||||||
file(raw_key, "rb").read())
|
open(raw_key, "rb").read())
|
||||||
if self.ssl.get("v3_only", False):
|
if self.ssl.get("v3_only", False):
|
||||||
method = tcp.SSLv3_METHOD
|
method = tcp.SSLv3_METHOD
|
||||||
options = OpenSSL.SSL.OP_NO_SSLv2 | OpenSSL.SSL.OP_NO_TLSv1
|
options = OpenSSL.SSL.OP_NO_SSLv2 | OpenSSL.SSL.OP_NO_TLSv1
|
||||||
|
Loading…
Reference in New Issue
Block a user