summaryrefslogtreecommitdiff
path: root/client/src/leap/soledad/client/http_target/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/leap/soledad/client/http_target/__init__.py')
-rw-r--r--client/src/leap/soledad/client/http_target/__init__.py21
1 files changed, 3 insertions, 18 deletions
diff --git a/client/src/leap/soledad/client/http_target/__init__.py b/client/src/leap/soledad/client/http_target/__init__.py
index 590ae8f6..b67d03f6 100644
--- a/client/src/leap/soledad/client/http_target/__init__.py
+++ b/client/src/leap/soledad/client/http_target/__init__.py
@@ -24,10 +24,7 @@ after receiving.
import os
-from cookielib import CookieJar
-
from twisted.web.client import Agent
-from twisted.web.client import CookieAgent
from twisted.internet import reactor
from leap.common.certs import get_compatible_ssl_context_factory
@@ -47,14 +44,6 @@ if os.environ.get('SOLEDAD_STATS'):
DO_STATS = True
-def newCookieAgent(cert_file):
- _factory = get_compatible_ssl_context_factory(cert_file)
- _agent = Agent(reactor, _factory)
- _cookieJar = CookieJar()
- agent = CookieAgent(_agent, _cookieJar)
- return agent
-
-
class SoledadHTTPSyncTarget(SyncTargetAPI, HTTPDocSender, HTTPDocFetcher):
"""
@@ -66,8 +55,7 @@ class SoledadHTTPSyncTarget(SyncTargetAPI, HTTPDocSender, HTTPDocFetcher):
the parsed documents that the remote send us, before being decrypted and
written to the main database.
"""
- def __init__(self, url, source_replica_uid, creds, crypto, cert_file,
- agent=None):
+ def __init__(self, url, source_replica_uid, creds, crypto, cert_file):
"""
Initialize the sync target.
@@ -85,8 +73,6 @@ class SoledadHTTPSyncTarget(SyncTargetAPI, HTTPDocSender, HTTPDocFetcher):
the SSL certificate used by the remote soledad
server.
:type cert_file: str
- :param agent: an http agent
- :type agent: twisted.web.client.Agent
"""
if url.endswith("/"):
url = url[:-1]
@@ -101,9 +87,8 @@ class SoledadHTTPSyncTarget(SyncTargetAPI, HTTPDocSender, HTTPDocFetcher):
self._insert_doc_cb = None
# Twisted default Agent with our own ssl context factory
- if not agent:
- agent = newCookieAgent(cert_file)
- self._http = agent
+ factory = get_compatible_ssl_context_factory(cert_file)
+ self._http = Agent(reactor, factory)
if DO_STATS:
self.sync_exchange_phase = [0]