﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34504	SSLCertVerificationError on outgoing emails for some mailboxes	Kamen Kalchev	nobody	"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)
}}}
"	Bug	new	Core (Mail)	4.2	Normal		smtplib, ssl, Django4.2		Unreviewed	0	0	0	0	0	0
