wget 不进行ssl 证书认证 no-check-certificate

创建日期: 2024-08-27 10:05 | 作者: 风波 | 浏览次数: 14 | 分类: shell

有些开源项目在进行编译的时候会使用 wget 拉取开源代码,结果但是自己搭建的高仿版 github.com 仓库的 ssl 证书是自签名的,需要让 wget 不进行证书认证。

修改方式为,把 /usr/bin/wget 程序换了 1. 将 /usr/bin/wget 改名字为 /usr/bin/wget.bin 1. 创建文件 /usr.bin/wget,内容为

#!/bin/bash
/usr/bin/wget.bin --no-check-certificate "${@}"
  1. 修改 /usr/bin/wget 脚本的可执行权限
chmod 775 /usr/bin/wget

这样 wget 命令在被执行的时候就带上了 --no-check-certificate 参数。

注:git 命令不进行 ssl 证书检测的方式 修改文件 ~/.gitconfig,增加如下内容

[http]
    sslVerify = false
14 浏览
0 评论