You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装Google Cloud Shell时遇SSL证书验证失败问题求助

解决Google Cloud Shell安装时的SSL证书链自签名错误

以下是针对 certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129) 错误的几种解决方法:

  • 临时跳过证书验证(仅用于测试场景)
    若只是临时调试,可通过环境变量或gcloud配置关闭SSL验证:

    # Python环境临时关闭验证
    export PYTHONHTTPSVERIFY=0
    
    # gcloud全局关闭SSL验证
    gcloud config set core/verify_ssl false
    

    ⚠️ 注意:该方法会降低安全性,禁止在生产环境使用。

  • 导入信任自签名证书

    1. 找到系统CA证书存储路径:
      • Linux:/etc/ssl/certs/ca-certificates.crt
      • macOS:/usr/local/etc/openssl/cert.pem
      • Windows:通过「证书管理器」(certmgr.msc)图形界面操作
    2. 将你的自签名证书添加到上述存储文件,或通过系统证书工具导入并设为信任
    3. 配置gcloud使用自定义CA证书:
      gcloud config set core/custom_ca_certs_file "/path/to/your/self-signed-cert.pem"
      
  • 排查代理相关问题
    如果网络通过代理访问,大概率是代理的自签名证书未被信任:

    • 确保代理证书已加入系统信任列表
    • 配置gcloud适配代理及证书:
      gcloud config set proxy/type http
      gcloud config set proxy/address <代理地址>
      gcloud config set proxy/port <代理端口>
      gcloud config set core/custom_ca_certs_file "/path/to/proxy-cert.pem"
      
  • 重置gcloud配置
    若以上方案无效,可尝试重置gcloud配置后重新初始化:

    gcloud config configurations create default
    gcloud init
    

内容的提问来源于stack exchange,提问作者Kunal Shah

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 20:04:57