我在服务器上设置了一个(私有)apt 存储库。我只允许通过 SSL 访问此存储库,并且只能使用客户端证书。我已经使用curl测试了连接:
$ curl --cacert /opt/CA.crt --cert /opt/user.crt --key /opt/user.key
Run Code Online (Sandbox Code Playgroud)
https://example.com/dists/lucid/main/binary-amd64/Packages.gz 内容按预期下载。
我在 /etc/apt/apt.conf.d/45example-com 中创建了一个文件
Debug::Acquire::https "true";
Acquire::https::example.com {
Verify-Peer "false";
Verify-Host "false";
CaInfo "/opt/CA.crt";
SslCert "/opt/user.crt";
SslKey "/opt/user.key";
};
Run Code Online (Sandbox Code Playgroud)
我在 /etc/apt/sources.list.d/example.com.list 添加了一个文件:
deb https://example.com/ lucid main
CA 证书似乎有问题,当我尝试更新时,出现以下信息:
> apt-get update
> * Connected to example.com (8.0.0.8) port 443 (#0)
> * found 1 certificates in /opt/CA.crt
> * error reading X.509 key or certificate file
> * Closing connection #0
Run Code Online (Sandbox Code Playgroud)
example.com 上的服务器日志显示没有请求到达那里,所以我猜测 apt-get 在尝试发送请求之前失败了(与日志显示的内容相符)。
我很难在互联网上找到有关带有 ssl …