plugin attach: disable TLS check if "check_certificate" is disabled
This commit is contained in:
parent
9de55ff588
commit
5a9886d390
2 changed files with 8 additions and 3 deletions
|
|
@ -78,9 +78,15 @@ class AttachPlugin:
|
||||||
progress_id = attachment.get("progress_id")
|
progress_id = attachment.get("progress_id")
|
||||||
if progress_id:
|
if progress_id:
|
||||||
options["progress_id"] = attachment["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):
|
if client.encryption.isEncryptionRequested(data):
|
||||||
# FIXME: we should not use implementation specific value here
|
# 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.
|
# with upload.
|
||||||
options['encryption'] = C.ENC_AES_GCM
|
options['encryption'] = C.ENC_AES_GCM
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# SàT plugin for HTTP File Upload (XEP-0363)
|
||||||
# SAT plugin for HTTP File Upload (XEP-0363)
|
|
||||||
# Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org)
|
# Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org)
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue