mirror of
https://github.com/django/django.git
synced 2024-12-28 03:55:50 +00:00
[4.2.x] Fixed #34386 -- Made SMTP backend load default system root CA certificates by default.
Regression in2848e5d0ce
. Backport ofc914d6cff1
from main
This commit is contained in:
parent
afb200e3ab
commit
b9d89d74f7
@ -57,10 +57,12 @@ class EmailBackend(BaseEmailBackend):
|
|||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def ssl_context(self):
|
def ssl_context(self):
|
||||||
ssl_context = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_CLIENT)
|
|
||||||
if self.ssl_certfile or self.ssl_keyfile:
|
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)
|
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):
|
def open(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user