aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libpathod/pathoc.py8
-rw-r--r--libpathod/pathod.py1
-rw-r--r--test/test_pathoc.py2
3 files changed, 8 insertions, 3 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py
index a32e13b5..af43defc 100644
--- a/libpathod/pathoc.py
+++ b/libpathod/pathoc.py
@@ -218,8 +218,12 @@ class Pathoc(tcp.TCPClient):
if self.use_http2:
if not OpenSSL._util.lib.Cryptography_HAS_ALPN: # pragma: nocover
- print >> sys.stderr, "HTTP/2 requires ALPN support. Please use OpenSSL >= 1.0.2."
- print >> sys.stderr, "Pathoc might not be working as expected without ALPN."
+ log.write(
+ 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)
else:
# TODO: create HTTP or Websockets protocol
diff --git a/libpathod/pathod.py b/libpathod/pathod.py
index fc63da18..e6c83185 100644
--- a/libpathod/pathod.py
+++ b/libpathod/pathod.py
@@ -314,7 +314,6 @@ class PathodHandler(tcp.BaseHandler):
self.server.craftanchor
)])
-
if anchor_gen:
spec = anchor_gen.next()
diff --git a/test/test_pathoc.py b/test/test_pathoc.py
index cf12332c..6b037bcc 100644
--- a/test/test_pathoc.py
+++ b/test/test_pathoc.py
@@ -123,10 +123,12 @@ class TestDaemonSSL(_TestDaemon):
assert d["log"][0]["request"]["clientcert"]["keyinfo"]
def test_http2_without_ssl(self):
+ fp = cStringIO.StringIO()
c = pathoc.Pathoc(
("127.0.0.1", self.d.port),
use_http2=True,
ssl=False,
+ fp = fp
)
tutils.raises(NotImplementedError, c.connect)