1
0
mirror of https://github.com/django/django.git synced 2024-12-27 11:35:53 +00:00

[4.2.x] Fixed #34386 -- Made SMTP backend load default system root CA certificates by default.

Regression in 2848e5d0ce.

Backport of c914d6cff1 from main
This commit is contained in:
Dmitriy Sintsov 2023-03-05 12:07:35 +03:00 committed by Mariusz Felisiak
parent afb200e3ab
commit b9d89d74f7

View File

@ -57,10 +57,12 @@ class EmailBackend(BaseEmailBackend):
@cached_property
def ssl_context(self):
ssl_context = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_CLIENT)
if self.ssl_certfile or self.ssl_keyfile:
ssl_context = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_CLIENT)
ssl_context.load_cert_chain(self.ssl_certfile, self.ssl_keyfile)
return ssl_context
return ssl_context
else:
return ssl.create_default_context()
def open(self):
"""