summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/leap/soledad/client/_http.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/leap/soledad/client/_http.py b/src/leap/soledad/client/_http.py
index f6e2e28e..1a1260b0 100644
--- a/src/leap/soledad/client/_http.py
+++ b/src/leap/soledad/client/_http.py
@@ -18,6 +18,7 @@
A twisted-based, TLS-pinned, token-authenticated HTTP client.
"""
import base64
+import os
from twisted.internet import reactor
from twisted.web.iweb import IAgent
@@ -58,7 +59,8 @@ class PinnedTokenAgent(Agent):
self.set_token(token)
# pin this agent with the platform TLS certificate
factory = getPolicyForHTTPS(cert_file)
- pool = HTTPConnectionPool(reactor, persistent=True)
+ persistent = os.environ.get('SOLEDAD_HTTP_PERSIST', None)
+ pool = HTTPConnectionPool(reactor, persistent=bool(persistent))
Agent.__init__(self, reactor, contextFactory=factory, pool=pool)
def set_token(self, token):