C
C
cegthgtlhj2020-08-30 04:16:14
Django
cegthgtlhj, 2020-08-30 04:16:14

Ubuntu 20.04.1 + Nginx + Django not sending SSL mail: DH_KEY_TOO_SMALL] dh key too small. What options?

Let's Encript SSL certificate is on the
working server. Mail is not sent from the working server.

I launched this module in the django console

from django.core.mail import send_mail
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.goneo.de'
EMAIL_PORT = 587
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = '123456'
EMAIL_USE_TLS = True

send_mail("SUBJECT", "TXT-MSG", '[email protected]', ['[email protected]'])


an error occurs

>>> from prod.pedro import *
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/oleg/dj/ako/prod/pedro.py", line 10, in <module>
    send_mail("SUBJECT", "TXT-MSG", '[email protected]', ['[email protected]'])
  File "/home/oleg/dj/venv/lib/python3.8/site-packages/django/core/mail/__init__.py", line 60, in send_mail
    return mail.send()
  File "/home/oleg/dj/venv/lib/python3.8/site-packages/django/core/mail/message.py", line 276, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/home/oleg/dj/venv/lib/python3.8/site-packages/django/core/mail/backends/smtp.py", line 102, in send_messages
    new_conn_created = self.open()
  File "/home/oleg/dj/venv/lib/python3.8/site-packages/django/core/mail/backends/smtp.py", line 67, in open
    self.connection.starttls(keyfile=self.ssl_keyfile, certfile=self.ssl_certfile)
  File "/usr/lib/python3.8/smtplib.py", line 774, in starttls
    self.sock = context.wrap_socket(self.sock,
  File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1108)


Some solutions are discussed on the Internet to change the SSL config and reduce the protocol security level, as here, for example
https://askubuntu.com/questions/1233186/ubuntu-20-...
Given my zero knowledge in this area, please Recommend a solution that a person who saw Linux for the first time in his life 3 weeks ago could independently implement.

Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cegthgtlhj, 2020-09-06
@cegthgtlhj

this solved the issue
https://askubuntu.com/questions/1233186/ubuntu-20-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question