1

I am trying to authorize access to Earth Engine via earthengine authenticate but get the following error:

  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\urllib\request.py", line 1350, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\http\client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\http\client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\http\client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\http\client.py", line 1010, in _send_output
    self.send(msg)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\http\client.py", line 950, in send
    self.connect()
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\http\client.py", line 1424, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\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:1124)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\Scripts\earthengine-script.py", line 9, in <module>
    sys.exit(main())
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\site-packages\ee\cli\eecli.py", line 84, in main
    _run_command()
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\site-packages\ee\cli\eecli.py", line 63, in _run_command
    dispatcher.run(args, config)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\site-packages\ee\cli\commands.py", line 353, in run
    self.command_dict[vars(args)[self.dest]].run(args, config)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\site-packages\ee\cli\commands.py", line 386, in run
    ee.Authenticate(**args_auth)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\site-packages\ee\__init__.py", line 86, in Authenticate
    oauth.authenticate(authorization_code, quiet, code_verifier)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\site-packages\ee\oauth.py", line 233, in authenticate
    _obtain_and_write_token(None, code_verifier)  # Will prompt for auth_code.
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\site-packages\ee\oauth.py", line 139, in _obtain_and_write_token
    token = request_token(auth_code.strip(), code_verifier)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\site-packages\ee\oauth.py", line 82, in request_token
    response = request.urlopen(
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\urllib\request.py", line 525, in open
    response = self._open(req, data)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\urllib\request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\urllib\request.py", line 1393, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "C:\Users\jwiesehahn\Anaconda3\envs\treespecies\lib\urllib\request.py", line 1353, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1124)>

Otherwise I have access to Earth Engine. I am running this in a new conda environment with Python 3.8.1. Running it with Python 3.6.1 results in a similar error ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852). And running this on a different maschine does not result in errors.

Do you have any ideas?

  • I don't think it's a GEE specific issue ... maybe [this SO question](https://stackoverflow.com/questions/51390968/python-ssl-certificate-verify-error) or [that SO question](https://stackoverflow.com/questions/51925384/unable-to-get-local-issuer-certificate-when-using-requests-in-python) can get you on the right track – Val Nov 16 '20 at 10:30

0 Answers0