我在全新安装的 FreeBSD 上,想要从私有 BitBucket 存储库下载并运行安装后脚本。我的获取尝试返回了身份验证错误:
~# fetch "https://bitbucket.org/me/server/raw/abcde...xyz/post-install.sh"
Certificate verification failed for /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV CA-1
34380949368:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed:/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/s3_clnt.c:1180:
fetch: https://bitbucket.org/me/server/raw/abcde...xyz/post-install.sh: Authentication error
有没有一种方法可以进行身份验证(从命令行或提示输入用户名/密码)并下载文件而无需安装其他软件包?
编辑1:
以下wget
命令做工作:
~# wget --no-check-certificate --user myname --password mypass "https://bitbucket.org/me/server/raw/abcde...xyz/post-install.sh"
~# wget --no-check-certificate "https://myname:[email protected]/me/server/raw/abcde...xyz/post-install.sh"
然而,以下fetch
仍然失败:
~# fetch --no-verify-peer "https://myname:[email protected]/me/server/raw/abcde...xyz/post-install.sh"
但它不会抛出错误,它只是下载了错误的文件——HTML BitBucket 登录表单。
编辑2:
正如 @SteveWills 推断的那样,BitBucket 不太关心fetch
;更改用户代理允许身份验证工作:
~# fetch --no-verify-peer --user-agent "Wget/1.16 (freebsd10.0)" "https://myname:[email protected]/me/server/raw/abcde...xyz/post-install.sh"
答案1
添加 --no-verify-peer 选项将修复认证验证错误。如果你想进行身份验证,只需将用户/密码添加到 url 中即可https://用户:[电子邮件受保护]/小路