Skip to content

Can not connect to smtp server to send email: certificate verify failed: unable to get local issuer certificate #3385

@ezacitoy

Description

@ezacitoy

Running Calibre-web on my mac laptop and would like to send books to my kindle. But when I tried to configure email it would not send.

I followed the instructions on https://riseup.net/en/email/settings/smtp (my email provider), but the issue persists. I dont have issue connecting to riseup on thunderbird on the same laptop, so I dont think its a connection issue.

To Reproduce

Steps to reproduce the behavior:

  1. install on mac laptop following steps in readme
  2. setup email settings as indicated by riseup
  3. see ssl cert error

logs

DEBUG {cps.tasks.mail:197} Start sending e-mail
ERROR {cps.tasks.mail:186} [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)
Traceback (most recent call last):
  File "/Users/myusername/calibre-web-env/lib/python3.9/site-packages/calibreweb/cps/tasks/mail.py", line 168, in run
    self.send_standard_email(msg)
  File "/Users/myusername/calibre-web-env/lib/python3.9/site-packages/calibreweb/cps/tasks/mail.py", line 200, in send_standard_email
    self.asyncSMTP = EmailSSL(self.settings["mail_server"], self.settings["mail_port"],
  File "/Users/myusername/calibre-web-env/lib/python3.9/site-packages/calibreweb/cps/tasks/mail.py", line 109, in __init__
    smtplib.SMTP_SSL.__init__(self, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/smtplib.py", line 1034, in __init__
    SMTP.__init__(self, host, port, local_hostname, timeout,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/smtplib.py", line 253, in __init__
    (code, msg) = self.connect(host, port)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/smtplib.py", line 339, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/smtplib.py", line 1041, in _get_socket
    new_socket = self.context.wrap_socket(new_socket,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)
 DEBUG {cps.updater:331} Stable version: 0.6.24

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions