使用dput上传deb包时SSL验证问题

问题描述 投票:0回答:1

我正在通过

dh-make
实用程序构建 .deb 包。我必须通过
dput
实用程序将其上传到 gitlab debain 存储库。

软件包构建后,我运行以下命令:

cat <<EOF > dput.cf
[gitlab]
method = https
fqdn = <my login>:<my password>@gitlab.mydomain.com
incoming = /api/v4/projects/<project id>/packages/debian
EOF

dput --config=dput.cf --unchecked --no-upload-log gitlab <my package name>_1.0.1_amd64.changes

我得到这个输出日志:

Uploading <my package name> using https to gitlab (host: <my login>:<my password>@gitlab.mydomain.com; directory: /api/v4/projects/<project id>/packages/debian)
running allowed-distribution: check whether a local profile permits uploads to the target distribution
running checksum: verify checksums before uploading
running suite-mismatch: check the target distribution for common errors
running gpg: check GnuPG signatures before the upload
Not checking GPG signature due to allow_unsigned_uploads being set.
Not writing upload log upon request
Uploading <my package name>_1.0.1.dsc
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)>

我使用的是 Ubuntu 22.04。 我该怎么办?

附注我的个人 gitlab ssl 证书(自签名)以这种方式添加到受信任:

mkdir -p /usr/local/share/ca-certificates

openssl s_client -showcerts -connect gitlab.mydomain.com:443 -servername gitlab.mydomain.com < /dev/null 2>/dev/null | openssl x509 -outform PEM > /usr/local/share/ca-certificates/gitlab.mydomain.com.crt

update-ca-certificates

当我通过http测试时一切都很好,但现在由于安全原因只剩下https了。

非常感谢您的任何提示。

我尝试用谷歌搜索它,大约一半的答案告诉我有关 python ssl 配置(通过

certifi
),没有任何帮助我。

所以我绕着

urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]
转了一圈又一圈,但仍然没有运气。

python ssl debian deb dput
1个回答
0
投票

我的朋友找到了一种解决方法来禁用

dput
的 SSL 验证:

sed -i '24s/^/import ssl\nssl._create_default_https_context = ssl._create_unverified_context\n/' /usr/bin/dput

感谢所有试图提供帮助的人。

© www.soinside.com 2019 - 2024. All rights reserved.