i got this error while trying to install google cloud cli
requests.exceptions.SSLError: HTTPSConnectionPool(host='dl.google.com', port=443): Max retries exceeded with url: /dl/cloudsdk/channels/rapid/components-2.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')))
Hello @mohamed_amin,
Welcome to Google Cloud Community!
Take a look at this Stackoverflow Post as you might have the same problem.
Also, you can disable the SSL verification by running the command below:
gcloud config set auth/disable_ssl_validation True
If the above options don't work, you can contact Google Cloud Support to further look into your case. Hope it helps, thanks!
Hi, this is happening to me to during google-cloud-sdk installation. `brew install --cask google-cloud-sdk`.
I've tried downloading trusts and exporting the following variables. It doesn't affect/change the installer failure:
```bash
export REQUESTS_CA_BUNDLE=~/standard_trusts.pem;
export CURL_CA_BUNDLE=~/standard_trusts.pem
export SSL_CERT_FILE=~/standard_trusts.crt
```
Error Logs:
```logs
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-cask/964385f0e340273e1dc2a176eb12cb8df76e1363/Ca...
Already downloaded: /Users/jsticha/Library/Caches/Homebrew/downloads/8ebc7cf3fc775ae92295de9eb004061a2ad42d557ef05f653a337d9c2bfe9eaf--google-cloud-sdk.rb
==> Downloading https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-492.0.0-darwin-arm.tar.g...
Already downloaded: /Users/jsticha/Library/Caches/Homebrew/downloads/8dddf7d4b64c3985914577e91cb01e056c6b58800cba623fa2c83c654454fd97--google-cloud-cli-492.0.0-darwin-arm.tar.gz
All dependencies satisfied.
==> Installing Cask google-cloud-sdk
==> Running installer script 'google-cloud-sdk/install.sh'
Welcome to the Google Cloud CLI!
Traceback (most recent call last):
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/urllib3/connectionpool.py", line 717, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/urllib3/connectionpool.py", line 406, in _make_request
self._validate_conn(conn)
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/urllib3/connectionpool.py", line 1057, in _validate_conn
conn.connect()
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/urllib3/connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/urllib3/util/ssl_.py", line 454, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/urllib3/util/ssl_.py", line 498, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 455, in wrap_socket
return self.sslsocket_class._create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 1042, in _create
self.do_handshake()
File "/opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/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 "/opt/homebrew/share/google-cloud-sdk/lib/third_party/requests/adapters.py", line 439, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/urllib3/connectionpool.py", line 799, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='dl.google.com', port=443): Max retries exceeded with url: /dl/cloudsdk/channels/rapid/components-2.json (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 "/opt/homebrew/share/google-cloud-sdk/bin/bootstrapping/install.py", line 395, in <module>
main()
File "/opt/homebrew/share/google-cloud-sdk/bin/bootstrapping/install.py", line 368, in main
Install(
File "/opt/homebrew/share/google-cloud-sdk/bin/bootstrapping/install.py", line 228, in Install
_CLI.Execute(['--quiet', 'components', 'list'])
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 1024, in Execute
self._HandleAllErrors(exc, command_path_string, specified_arg_names)
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 1061, in _HandleAllErrors
exceptions.HandleError(exc, command_path_string, self.__known_error_handler)
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/calliope/exceptions.py", line 557, in HandleError
core_exceptions.reraise(exc)
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/exceptions.py", line 149, in reraise
six.reraise(type(exc_value), exc_value, tb)
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/six/__init__.py", line 719, in reraise
raise value
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 998, in Execute
resources = calliope_command.Run(cli=self, args=args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 838, in Run
resources = command_instance.Run(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/surface/components/list.py", line 102, in Run
result = update_manager.List(show_hidden=args.show_hidden,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/updater/update_manager.py", line 759, in List
to_print, current_version, latest_version = self._GetPrintListWithDiff()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/updater/update_manager.py", line 802, in _GetPrintListWithDiff
_, diff = self._GetStateAndDiff(command_path='components.list')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/updater/update_manager.py", line 685, in _GetStateAndDiff
latest_snapshot = self._GetLatestSnapshot(version=version,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/updater/update_manager.py", line 668, in _GetLatestSnapshot
return snapshots.ComponentSnapshot.FromURLs(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/updater/snapshots.py", line 176, in FromURLs
(ComponentSnapshot._DictFromURL(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/updater/snapshots.py", line 200, in _DictFromURL
response = installers.MakeRequest(url, command_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/updater/installers.py", line 115, in MakeRequest
return _RawRequest(url, headers=headers, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/updater/installers.py", line 163, in _RawRequest
return retryer.RetryOnException(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/util/retry.py", line 201, in RetryOnException
exceptions.reraise(exc_info[1], tb=exc_info[2])
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/exceptions.py", line 149, in reraise
six.reraise(type(exc_value), exc_value, tb)
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/six/__init__.py", line 719, in reraise
raise value
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/util/retry.py", line 182, in TryFunc
return func(*args, **kwargs), None
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/updater/installers.py", line 196, in _ExecuteRequestAndRaiseExceptions
response = requests_session.get(
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/requests/sessions.py", line 557, in get
return self.request('GET', url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/transport.py", line 269, in WrappedRequest
response = orig_request(*modified_args, **modified_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/googlecloudsdk/core/requests.py", line 246, in WrappedRequest
return orig_request_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/requests/sessions.py", line 544, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/requests/sessions.py", line 657, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/share/google-cloud-sdk/lib/third_party/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='dl.google.com', port=443): Max retries exceeded with url: /dl/cloudsdk/channels/rapid/components-2.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')))
```
Hello @joel_s ,Welcome on Google Cloud Community.
Why aren't you use official way of installing CLI on MAC?
https://cloud.google.com/sdk/docs/install-sdk#mac
--
cheers,
DamianS
LinkedIn medium.com Cloudskillsboost Sessionize Youtube