summaryrefslogtreecommitdiff
path: root/scripting/source
diff options
context:
space:
mode:
authorThorsten Behrens <thorsten.behrens@allotropia.de>2023-07-29 05:17:10 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-07-30 21:59:19 +0200
commitd7b8dc9f3f866d65c2e1ae3727b3738ae954e325 (patch)
treecd6f45c79c5a84cb33e892e9665240b369f29fd7 /scripting/source
parent3e563f6ed42224e5c7fbb11428604a7719e178af (diff)
Log SSL default verification path for mailmerge debug
related: follow python recommendation and pass SSL contexts Change-Id: I992535a7fbe0bd21ff1de8241715babc0cb5cdc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155050 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'scripting/source')
-rw-r--r--scripting/source/pyprov/mailmerge.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py
index 6bd80430d147..40be53b9366a 100644
--- a/scripting/source/pyprov/mailmerge.py
+++ b/scripting/source/pyprov/mailmerge.py
@@ -96,6 +96,8 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
if dbg:
print("Timeout: " + str(tout), file=sys.stderr)
if port == 465:
+ if dbg:
+ print("SSL config: " + str(ssl.get_default_verify_paths()), file=sys.stderr)
self.server = smtplib.SMTP_SSL(server, port, timeout=tout, context=ssl.create_default_context())
else:
self.server = smtplib.SMTP(server, port,timeout=tout)
@@ -107,6 +109,8 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
if dbg:
print("ConnectionType: " + connectiontype, file=sys.stderr)
if connectiontype.upper() == 'SSL' and port != 465:
+ if dbg:
+ print("SSL config: " + str(ssl.get_default_verify_paths()), file=sys.stderr)
self.server.ehlo()
self.server.starttls(context=ssl.create_default_context())
self.server.ehlo()
@@ -299,6 +303,8 @@ class PyMailIMAPService(unohelper.Base, XMailService):
print(connectiontype, file=sys.stderr)
print("BEFORE", file=sys.stderr)
if connectiontype.upper() == 'SSL':
+ if dbg:
+ print("SSL config: " + str(ssl.get_default_verify_paths()), file=sys.stderr)
self.server = imaplib.IMAP4_SSL(server, port, ssl_context=ssl.create_default_context())
else:
self.server = imaplib.IMAP4(server, port)
@@ -368,6 +374,8 @@ class PyMailPOP3Service(unohelper.Base, XMailService):
print(connectiontype, file=sys.stderr)
print("BEFORE", file=sys.stderr)
if connectiontype.upper() == 'SSL':
+ if dbg:
+ print("SSL config: " + str(ssl.get_default_verify_paths()), file=sys.stderr)
self.server = poplib.POP3_SSL(server, port, context=ssl.create_default_context())
else:
tout = xConnectionContext.getValueByName("Timeout")