mirror of
https://github.com/django/django.git
synced 2025-10-03 15:24:43 +00:00
Fixed #34386 -- Made SMTP backend load default system root CA certificates by default.
Regression in 2848e5d0ce
.
This commit is contained in:
parent
b05dfc2894
commit
c914d6cff1
1 changed files with 4 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue