1

With the book "automate the boring stuff with python" I try to learn some programming basics. Currently, I am learning about IMAP Servers. Installing the module imapclient and pyzmail36 worked out pretty well, but the next step doesn´t.

>>> import imapclient
>>> imapObj = imapclient.IMAPClient('imap.gmail.com',ssl=True) 

The book tells me, to go on like this, bug a huge Error occurs if I do so. I do not want to copy it all, since it includes my full name (users), but I guesss this is the main problem :

  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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:1108)
>>> 

Unfortunately, I can not move on with the Chapter, without logging into the server.

Thank you guys!

rdas
  • 20,604
  • 6
  • 33
  • 46
  • Basically, the CA certificates to verify the certificate returned by the mail server do not exist. Try searching for something like "add/update certificate python". – Toothbrush Jun 16 '20 at 11:06

1 Answers1

0

It seems to have problems with MacOS. I found a similar situation encountered here.

Try the solutions mentioned in the above link.

Otherwise, Try by changing ssl to False. It will make your connection insecure, I mean the data coming to you will be plain text. Anyway, Since you are learning it, Try both ways.

Appaji Chintimi
  • 613
  • 2
  • 7
  • 19