From 1af022bb10fc3ca7099f60afd929d2366e517108 Mon Sep 17 00:00:00 2001 From: Nuwan Goonasekera <2070605+nuwang@users.noreply.github.com> Date: Fri, 3 May 2024 13:08:42 +0530 Subject: [PATCH] Increase timeouts and improve handling of high-latency connections --- ena_upload/ena_upload.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ena_upload/ena_upload.py b/ena_upload/ena_upload.py index be66bed..43595c7 100755 --- a/ena_upload/ena_upload.py +++ b/ena_upload/ena_upload.py @@ -39,6 +39,12 @@ def ntransfercmd(self, cmd, rest=None): conn = self.context.wrap_socket(conn, server_hostname=self.host, session=self.sock.session) + # fix reuse of ssl socket: + # https://stackoverflow.com/a/53456626/10971151 and + # https://stackoverflow.com/a/70830916/10971151 + def custom_unwrap(): + pass + conn.unwrap = custom_unwrap return conn, size @@ -407,7 +413,7 @@ def submit_data(file_paths, password, webin_id): print("\nConnecting to ftp.webin2.ebi.ac.uk....") try: - ftps = MyFTP_TLS(timeout=10) + ftps = MyFTP_TLS(timeout=120) ftps.context.set_ciphers('HIGH:!DH:!aNULL') ftps.connect(ftp_host, port=21) ftps.auth()