Search code examples
google-cloud-platformgcloud

Cloud SDK: Unverified HTTPS request is being made to host


When I run the command:

gcloud projects list

I get warnings:

google-cloud-sdk\bin\..\lib\third_party\urllib3\connectionpool.py:986: InsecureRequestWarning: Unverified HTTPS request is being made to host 'oauth2.googleapis.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,
google-cloud-sdk\bin\..\lib\third_party\urllib3\connectionpool.py:986: InsecureRequestWarning: Unverified HTTPS request is being made to host 'cloudresourcemanager.googleapis.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,

I use Cloud SDK on Windows 10.

What these warnings mean and how to fix them?


Solution

  • These are warnings not errors.

    They warn that the client (gcloud) isn't verifying the certificate(s) (hopefully being) received from Google. The client isn't verifying the certificate(s) certifying chain which proves the authenticity of the cert(s) and thus it's possible the certs that are received aren't the ones issued to Google, hence the warning.

    This may (not) being done bygcloud to avoid problems with corporate SSL proxies which can terminate SSL connections to monitor traffic.

    gcloud projects list uses 2 Google APIs oauth2 to authenticate you and cloudresourcemanager to list the projects. Other commands will throw different numbers of this warning for different sets of APIs being used.

    You may be able to configure Python or urllib3 to stop showing the warning but I'd recommend leaving it as-is.