mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
Output warning info to log fp using logging methods
This commit is contained in:
parent
0e15b94368
commit
94a7770a94
@ -218,8 +218,12 @@ class Pathoc(tcp.TCPClient):
|
|||||||
|
|
||||||
if self.use_http2:
|
if self.use_http2:
|
||||||
if not OpenSSL._util.lib.Cryptography_HAS_ALPN: # pragma: nocover
|
if not OpenSSL._util.lib.Cryptography_HAS_ALPN: # pragma: nocover
|
||||||
print >> sys.stderr, "HTTP/2 requires ALPN support. Please use OpenSSL >= 1.0.2."
|
log.write(
|
||||||
print >> sys.stderr, "Pathoc might not be working as expected without ALPN."
|
self.fp,
|
||||||
|
"HTTP/2 requires ALPN support. "
|
||||||
|
"Please use OpenSSL >= 1.0.2. "
|
||||||
|
"Pathoc might not be working as expected without ALPN."
|
||||||
|
)
|
||||||
self.protocol = http2.HTTP2Protocol(self)
|
self.protocol = http2.HTTP2Protocol(self)
|
||||||
else:
|
else:
|
||||||
# TODO: create HTTP or Websockets protocol
|
# TODO: create HTTP or Websockets protocol
|
||||||
|
@ -314,7 +314,6 @@ class PathodHandler(tcp.BaseHandler):
|
|||||||
self.server.craftanchor
|
self.server.craftanchor
|
||||||
)])
|
)])
|
||||||
|
|
||||||
|
|
||||||
if anchor_gen:
|
if anchor_gen:
|
||||||
spec = anchor_gen.next()
|
spec = anchor_gen.next()
|
||||||
|
|
||||||
|
@ -123,10 +123,12 @@ class TestDaemonSSL(_TestDaemon):
|
|||||||
assert d["log"][0]["request"]["clientcert"]["keyinfo"]
|
assert d["log"][0]["request"]["clientcert"]["keyinfo"]
|
||||||
|
|
||||||
def test_http2_without_ssl(self):
|
def test_http2_without_ssl(self):
|
||||||
|
fp = cStringIO.StringIO()
|
||||||
c = pathoc.Pathoc(
|
c = pathoc.Pathoc(
|
||||||
("127.0.0.1", self.d.port),
|
("127.0.0.1", self.d.port),
|
||||||
use_http2=True,
|
use_http2=True,
|
||||||
ssl=False,
|
ssl=False,
|
||||||
|
fp = fp
|
||||||
)
|
)
|
||||||
tutils.raises(NotImplementedError, c.connect)
|
tutils.raises(NotImplementedError, c.connect)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user