go certificate signed报错

三月 14, 2022 [openssl] #openssl #go #git

go certificate signed报错

CA证书

数字证书主要用来做签名认证,保证了信息和数据的完整性和安全性 但是在开发过程中经常发生内网环境的证书过期,导致依赖文件无法访问,编译报错 这里记录一下直接用http不加密的方式下载依赖文件

go

主要有几个环境变量, 这样访问这些网址时就会用http方式访问

export GOINSECURE=git.addr.com
export GOPRIVATE=git.addr.com
# export GOPROXY=https://goproxy.cn,direct

单个命令的http获取依赖库

go get --insecure golang.org/x/crypto/ripemd160

git

配置~/.gitconfig, 用于配置

[http]
        sslVerify = false

另外像bazel这种,依赖库很多是用git仓库的形式给出,如果git仓库需要user:password,同样可以修改配置(因为编译时不能弹出prompt数据用户名和密码)

[credential]
        helper = cache --timeout=36000000
        # helper = store