Skip to content

SSLV3_ALERT_HANDSHAKE_FAILURE #19

@ILPlais

Description

@ILPlais

Bug Report

  • I have checked that there is no existing issue dealing with this problem.

Summary

I'm trying to add my IMAP account. My server uses TLS on port 993.

Eonvelope version

Version 0.7.1

Steps to reproduce *

  1. On the page: /accounts/add/
  2. Username: lionel.plais@[RETRACTED]
  3. Server URL to: imapssl.[RETRACTED]
  4. Protocol: IMAP4
  5. Port: 993
  6. Timeout: 10s

Bug behaviour

Testing this account data failed: A SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] ssl/tls alert handshake failure (_ssl.c:1081) occurred during connecting on account!

Logs *

eonvelope-web  | 2026-06-08T16:43:08.751716680Z {"asctime": "2026-06-08 16:43:08,751", "levelname": "INFO", "name": "core.models.Account", "module": "Account", "funcName": "test", "lineno": 321, "message": "Testing Compte lionel.plais@[RETRACTED] avec le protocole IMAP4_SSL ..."}
eonvelope-web  | 2026-06-08T16:43:08.828932040Z {"asctime": "2026-06-08 16:43:08,822", "levelname": "ERROR", "name": "core.utils.fetchers.IMAP4_SSL_Fetcher", "module": "IMAP4_SSL_Fetcher", "funcName": "connect_to_host", "lineno": 80, "message": "Error connecting to Compte lionel.plais@[RETRACTED] avec le protocole IMAP4_SSL!", "exc_info": "Traceback (most recent call last):\n  File \"/opt/src/core/utils/fetchers/IMAP4_SSL_Fetcher.py\", line 67, in connect_to_host\n    self._mail_client = imaplib.IMAP4_SSL(\n                        ~~~~~~~~~~~~~~~~~^\n        host=mail_host,\n        ^^^^^^^^^^^^^^^\n    ...<2 lines>...\n        ssl_context=ssl_context,\n        ^^^^^^^^^^^^^^^^^^^^^^^^\n    )\n    ^\n  File \"/usr/local/lib/python3.14/imaplib.py\", line 1641, in __init__\n    IMAP4.__init__(self, host, port, timeout)\n    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.14/imaplib.py\", line 208, in __init__\n    self.open(host, port, timeout)\n    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.14/imaplib.py\", line 1654, in open\n    IMAP4.open(self, host, port, timeout)\n    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.14/imaplib.py\", line 318, in open\n    self.sock = self._create_socket(timeout)\n                ~~~~~~~~~~~~~~~~~~~^^^^^^^^^\n  File \"/usr/local/lib/python3.14/imaplib.py\", line 1645, in _create_socket\n    return self.ssl_context.wrap_socket(sock,\n           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n                                        server_hostname=self.host)\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.14/ssl.py\", line 455, in wrap_socket\n    return self.sslsocket_class._create(\n           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^\n        sock=sock,\n        ^^^^^^^^^^\n    ...<5 lines>...\n        session=session\n        ^^^^^^^^^^^^^^^\n    )\n    ^\n  File \"/usr/local/lib/python3.14/ssl.py\", line 1076, in _create\n    self.do_handshake()\n    ~~~~~~~~~~~~~~~~~^^\n  File \"/usr/local/lib/python3.14/ssl.py\", line 1372, in do_handshake\n    self._sslobj.do_handshake()\n    ~~~~~~~~~~~~~~~~~~~~~~~~~^^\nssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] ssl/tls alert handshake failure (_ssl.c:1081)"}
eonvelope-web  | 2026-06-08T16:43:08.839439051Z {"asctime": "2026-06-08 16:43:08,832", "levelname": "ERROR", "name": "core.models.Account", "module": "Account", "funcName": "get_fetcher", "lineno": 306, "message": "Failed to instantiate fetcher for Compte lionel.plais@[RETRACTED] avec le protocole IMAP4_SSL!", "exc_info": "Traceback (most recent call last):\n  File \"/opt/src/core/utils/fetchers/IMAP4_SSL_Fetcher.py\", line 67, in connect_to_host\n    self._mail_client = imaplib.IMAP4_SSL(\n                        ~~~~~~~~~~~~~~~~~^\n        host=mail_host,\n        ^^^^^^^^^^^^^^^\n    ...<2 lines>...\n        ssl_context=ssl_context,\n        ^^^^^^^^^^^^^^^^^^^^^^^^\n    )\n    ^\n  File \"/usr/local/lib/python3.14/imaplib.py\", line 1641, in __init__\n    IMAP4.__init__(self, host, port, timeout)\n    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.14/imaplib.py\", line 208, in __init__\n    self.open(host, port, timeout)\n    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.14/imaplib.py\", line 1654, in open\n    IMAP4.open(self, host, port, timeout)\n    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.14/imaplib.py\", line 318, in open\n    self.sock = self._create_socket(timeout)\n                ~~~~~~~~~~~~~~~~~~~^^^^^^^^^\n  File \"/usr/local/lib/python3.14/imaplib.py\", line 1645, in _create_socket\n    return self.ssl_context.wrap_socket(sock,\n           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n                                        server_hostname=self.host)\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.14/ssl.py\", line 455, in wrap_socket\n    return self.sslsocket_class._create(\n           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^\n        sock=sock,\n        ^^^^^^^^^^\n    ...<5 lines>...\n        session=session\n        ^^^^^^^^^^^^^^^\n    )\n    ^\n  File \"/usr/local/lib/python3.14/ssl.py\", line 1076, in _create\n    self.do_handshake()\n    ~~~~~~~~~~~~~~~~~^^\n  File \"/usr/local/lib/python3.14/ssl.py\", line 1372, in do_handshake\n    self._sslobj.do_handshake()\n    ~~~~~~~~~~~~~~~~~~~~~~~~~^^\nssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] ssl/tls alert handshake failure (_ssl.c:1081)\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File \"/opt/src/core/models/Account.py\", line 304, in get_fetcher\n    fetcher = self.get_fetcher_class()(self)\n  File \"/opt/src/core/utils/fetchers/IMAP4Fetcher.py\", line 104, in __init__\n    self.connect_to_host()\n    ~~~~~~~~~~~~~~~~~~~~^^\n  File \"/opt/src/core/utils/fetchers/IMAP4_SSL_Fetcher.py\", line 81, in connect_to_host\n    raise MailAccountError(error, _(\"connecting\")) from error\ncore.utils.fetchers.exceptions.MailAccountError: A SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] ssl/tls alert handshake failure (_ssl.c:1081) occurred during connecting on account!"}
eonvelope-web  | 2026-06-08T16:43:08.844529373Z {"asctime": "2026-06-08 16:43:08,844", "levelname": "INFO", "name": "core.mixins.HealthModelMixin", "module": "HealthModelMixin", "funcName": "set_unhealthy", "lineno": 70, "message": "Setting Compte lionel.plais@[RETRACTED] avec le protocole IMAP4_SSL to unhealthy because of error: A SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] ssl/tls alert handshake failure (_ssl.c:1081) occurred during connecting on account!"}
eonvelope-web  | 2026-06-08T16:43:08.844951510Z {"asctime": "2026-06-08 16:43:08,844", "levelname": "INFO", "name": "core.models.Account", "module": "Account", "funcName": "test", "lineno": 326, "message": "Testing Compte lionel.plais@[RETRACTED] avec le protocole IMAP4_SSL failed with error: A SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] ssl/tls alert handshake failure (_ssl.c:1081) occurred during connecting on account!."}
eonvelope-web  | 2026-06-08T16:43:08.845430463Z {"asctime": "2026-06-08 16:43:08,845", "levelname": "INFO", "name": "core.mixins.HealthModelMixin", "module": "HealthModelMixin", "funcName": "set_unhealthy", "lineno": 70, "message": "Setting Compte lionel.plais@[RETRACTED] avec le protocole IMAP4_SSL to unhealthy because of error: A SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] ssl/tls alert handshake failure (_ssl.c:1081) occurred during connecting on account!"}

Possible diagnosis

Errors in the TLS layer.

Fix it yourself?

I'm not that good! 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions