'gcloud init ssl errors on mac (M1)

I cant seem to initialize the gcloud

heres the log

enter image description here

the mac is new. anyone has any ideas?



Solution 1:[1]

There could be many possible reasons like :

  • Networking configurations and any proxy that can cause the handshake to fail.
  • Antivirus, firewalls, or any other software that are preventing the traffic.
  • Corporate certificates are being used.
  • A real SSL issue (there could be a captive portal in between you and Google)
  • A Python version/system libraries with SSL issues (2.7.11 seems to work for most users, but you can try different minor versions, like 2.7.10 or 2.7.9)

In order to Authenticate whether this error has occurred due to proxy or not, you can try running below commands:

$ curl https://dl.google.com/ 

**Output**: <a href="https://www.google.com/chrome"> Found </a>

If you get a different output from the above mentioned one then, you're behind a proxy or portal.

Solutions :

  • Try running npm config set strict-ssl false This is an alternative shared in this url https://github.com/nodejs/node/issues/3742. I wouldn’t recommend this but it's a short and quick solution.
  • Also have a look at this thread on how the user added certificates manually to perform significantly better behind corporate proxy as opposed to the strict-ssl option. This solution is for Windows, but a user confirmed in the comment it is for OSX as well.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Priyashree Bhadra