From 5a9886d39071ebcf00a2e0eb8668374b75b4d028 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 28 Feb 2020 10:06:23 +0100 Subject: [PATCH] plugin attach: disable TLS check if "check_certificate" is disabled --- sat/plugins/plugin_misc_attach.py | 8 +++++++- sat/plugins/plugin_xep_0363.py | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sat/plugins/plugin_misc_attach.py b/sat/plugins/plugin_misc_attach.py index 7da4b830..8314e695 100644 --- a/sat/plugins/plugin_misc_attach.py +++ b/sat/plugins/plugin_misc_attach.py @@ -78,9 +78,15 @@ class AttachPlugin: progress_id = attachment.get("progress_id") if progress_id: options["progress_id"] = attachment["progress_id"] + check_certificate = self.host.memory.getParamA( + "check_certificate", "Connection", profile_key=client.profile) + if not check_certificate: + options['ignore_tls_errors'] = True + log.warning( + _("certificate check disabled for upload, this is dangerous!")) if client.encryption.isEncryptionRequested(data): # FIXME: we should not use implementation specific value here - # but for not it's the only file encryption method available with + # but for now it's the only file encryption method available with # with upload. options['encryption'] = C.ENC_AES_GCM diff --git a/sat/plugins/plugin_xep_0363.py b/sat/plugins/plugin_xep_0363.py index a1f6ca90..1e2a5ae0 100644 --- a/sat/plugins/plugin_xep_0363.py +++ b/sat/plugins/plugin_xep_0363.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 - -# SAT plugin for HTTP File Upload (XEP-0363) +# SàT plugin for HTTP File Upload (XEP-0363) # Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org) # This program is free software: you can redistribute it and/or modify