hawkins / Shawk

Library to Send & Receive SMS for Free using Email or Your Phone Number
https://shawk.now.sh/
MIT License
16 stars 4 forks source link

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045) #19

Open MatteoAntolini opened 5 years ago

MatteoAntolini commented 5 years ago

My code: import shawk client = shawk.Client('******@gmail.com', '************')

My error:

Traceback (most recent call last): File "/", line 2, in <module> client = shawk.Client('******@gmail.com', '************') File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shawk/Client.py", line 49, in __init__ self.setup_inbox(pwd, auto=self.auto_refresh_enabled) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shawk/Client.py", line 163, in setup_inbox self.imap = imapclient.IMAPClient('imap.gmail.com', ssl=ssl) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/imapclient/imapclient.py", line 254, in __init__ self._imap = self._create_IMAP4() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/imapclient/imapclient.py", line 289, in _create_IMAP4 self._timeout) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/imapclient/tls.py", line 44, in __init__ imaplib.IMAP4.__init__(self, host, port) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/imaplib.py", line 197, in __init__ self.open(host, port) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/imapclient/tls.py", line 50, in open self.sock = wrap_socket(sock, self.ssl_context, host) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/imapclient/tls.py", line 32, in wrap_socket return ssl_context.wrap_socket(sock, server_hostname=host) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 412, in wrap_socket session=session File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 850, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1108, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)

hawkins commented 5 years ago

Looks like we couldn’t establish an ssl connection... I don’t know what to tell you, aside from you could modify the Shawk code to not use ssl (I think there’s an ssl=False argument to pass to imapclient)