Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Encountered "CERTIFICATE_VERIFY_FAILED" "certificate verify failed: unable to get local issuer certificate" error on windows 11 with python 3.12.4 #118

hizhubo started this conversation in General
Discussion options

Ran command enex2notion --token my-token --root-page EverNote ./output_dir/ on windows 11 with Python 3.12.4

Encountered error:

Traceback (most recent call last):
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\connectionpool.py", line 466, in _make_request
 self._validate_conn(conn)
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\connectionpool.py", line 1095, in _validate_conn
 conn.connect()
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\connection.py", line 652, in connect
 sock_and_verified = _ssl_wrap_socket_and_match_hostname(
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\connection.py", line 805, in _ssl_wrap_socket_and_match_hostname
 ssl_sock = ssl_wrap_socket(
 ^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\util\ssl_.py", line 465, in ssl_wrap_socket
 ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\util\ssl_.py", line 509, in _ssl_wrap_socket_impl
 return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1264.0_x64__qbz5n2kfra8p0\Lib\ssl.py", line 455, in wrap_socket
 return self.sslsocket_class._create(
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1264.0_x64__qbz5n2kfra8p0\Lib\ssl.py", line 1042, in _create
 self.do_handshake()
 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1264.0_x64__qbz5n2kfra8p0\Lib\ssl.py", line 1320, in do_handshake
 self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\connectionpool.py", line 789, in urlopen
 response = self._make_request(
 ^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\connectionpool.py", line 490, in _make_request
 raise new_e
urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\requests\adapters.py", line 667, in send
 resp = conn.urlopen(
 ^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\connectionpool.py", line 873, in urlopen
 return self.urlopen(
 ^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\connectionpool.py", line 873, in urlopen
 return self.urlopen(
 ^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\connectionpool.py", line 873, in urlopen
 return self.urlopen(
 ^^^^^^^^^^^^^
 [Previous line repeated 2 more times]
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\connectionpool.py", line 843, in urlopen
 retries = retries.increment(
 ^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\urllib3\util\retry.py", line 519, in increment
 raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.notion.so', port=443): Max retries exceeded with url: /api/v3/loadUserContent (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
 File "<frozen runpy>", line 198, in _run_module_as_main
 File "<frozen runpy>", line 88, in _run_code
 File "c:\users\username\.local\bin\enex2notion.exe\__main__.py", line 7, in <module>
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\enex2notion\cli.py", line 47, in main
 cli(sys.argv[1:])
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\enex2notion\cli.py", line 26, in cli
 root = get_root(args.token, args.root_page)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\enex2notion\cli_notion.py", line 21, in get_root
 client = get_notion_client(token)
 ^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\enex2notion\cli_notion.py", line 31, in get_notion_client
 return NotionClient(token_v2=token)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\notion\client.py", line 113, in __init__
 self._update_user_info()
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\notion\client.py", line 144, in _update_user_info
 records = self.post("loadUserContent", {}).json()["recordMap"]
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\ratelimit\decorators.py", line 113, in wrapper
 return func(*args, **kargs)
 ^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\ratelimit\decorators.py", line 80, in wrapper
 return func(*args, **kargs)
 ^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\notion\client.py", line 275, in post
 return self._post(endpoint, data)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\notion\client.py", line 283, in _post
 response = self.session.post(url, json=data)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\requests\sessions.py", line 637, in post
 return self.request("POST", url, data=data, json=json, **kwargs)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\requests\sessions.py", line 589, in request
 resp = self.send(prep, **send_kwargs)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\requests\sessions.py", line 703, in send
 r = adapter.send(request, **kwargs)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\username\pipx\venvs\enex2notion\Lib\site-packages\requests\adapters.py", line 698, in send
 raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.notion.so', port=443): Max retries exceeded with url: /api/v3/loadUserContent (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')))

Need help on resolving this issue. Thanks!

You must be logged in to vote

Replies: 3 comments

Comment options

I'm getting the exact same issue on Mac.

You must be logged in to vote
0 replies
Comment options

Ah, I've found the solution, it's unrelated to this particular library and more of a Python requests SSL issue where it isn't finding the certificate store. You just have to run some commands to give the Python environment access to the certificate store (or install a new cert store perhaps). Check out this article.

You must be logged in to vote
0 replies
Comment options

Not sure why but when I tried in windows PowerShell, I encountered the above issue. When I tried in windows CMD (not PowerSell), it finally worked...

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /