Opened 17 months ago

Last modified 17 months ago

#34504 closed Bug

SSLCertVerificationError on outgoing emails for some mailboxes — at Initial Version

Reported by: Kamen Kalchev Owned by: nobody
Component: Core (Mail) Version: 4.2
Severity: Normal Keywords: smtplib, ssl, Django4.2
Cc: Adam Johnson Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It looks like this was previously reported in a different scenario and marked as fixed but is still not working as expected. Downgrading Django to 4.1.7 fixes the problem with outgoing messages to the mailbox.

Environment:

Python3.10.6
Django4.2

Link to previously reported issue:
https://code.djangoproject.com/ticket/34386

Stacktrace:

File "/usr/local/lib/env3/lib/python3.10/site-packages/django/core/mail/message.py" line 298 in send [args] [locals]
return self.get_connection(fail_silently).send_messages([self])
File "/usr/local/lib/env3/lib/python3.10/site-packages/django/core/mail/backends/smtp.py" line 127 in send_messages [args] [locals]
new_conn_created = self.open()
File "/usr/local/lib/env3/lib/python3.10/site-packages/django/core/mail/backends/smtp.py" line 85 in open [args] [locals]
self.connection = self.connection_class(
File "/usr/lib/python3.10/smtplib.py" line 1050 in __init__ [args] [locals]
SMTP.__init__(self, host, port, local_hostname, timeout,
File "/usr/lib/python3.10/smtplib.py" line 255 in __init__ [args] [locals]
(code, msg) = self.connect(host, port)
File "/usr/lib/python3.10/smtplib.py" line 341 in connect [args] [locals]
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python3.10/smtplib.py" line 1057 in _get_socket [args] [locals]
new_socket = self.context.wrap_socket(new_socket,
File "/usr/lib/python3.10/ssl.py" line 513 in wrap_socket [args] [locals]
return self.sslsocket_class._create(
File "/usr/lib/python3.10/ssl.py" line 1071 in _create [args] [locals]
self.do_handshake()
File "/usr/lib/python3.10/ssl.py" line 1342 in do_handshake [args] [locals]
self._sslobj.do_handshake()
SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top