【问题标题】:TLS self-signed certificate for auth URL for Docker用于 Docker 的身份验证 URL 的 TLS 自签名证书
【发布时间】:2017-01-10 01:03:09
【问题描述】:

我正在尝试登录到您使用 oadm 工具构建的 Docker 注册表。我尝试使用令牌登录:

# docker login -u $(oc whoami) -e 'xxxx' -p $(oc whoami -t) 172.30.10.52:5000
Error response from daemon: no successful auth challenge for   
https://172.30.10.52:5000/v2/ - errors: [basic auth attempt to 
https://172.30.10.52:5000/v2/ realm "openshift" failed with status: 400 Bad 
Request]

查看日志,我可以看到问题是因为我的实例使用了自签名证书:

time="2017-01-10T00:58:42.913539516Z" level=error msg="error authorizing context: 
Get https://ld7-zko8s6q-ws:8443/oapi/v1/users/~: x509: 
certificate signed by unknown authority" 
go.version=go1.4.2 http.request.host="172.30.10.52:5000" 
http.request.id=3fa81975-3aa9-44d8-a6a8-c00ad360009c 
http.request.method=GET http.request.remoteaddr="10.1.0.1:49316" 
http.request.uri="/v2/" http.request.useragent="docker/1.10.3 go/go1.6.2 
git-commit/429be27-unsupported kernel/3.10.0-514.2.2.el7.x86_64 
os/linux arch/amd64" instance.id=2a23b229-2a0e-4734-83c4-38cb9c8a0e00 

如何让我的证书受信任或关闭 TLS 验证?

【问题讨论】:

    标签: ssl go docker certificate openshift-origin


    【解决方案1】:

    您可以通过添加来测试 insecure registry

    DOCKER_OPTS="--insecure-registry myregistrydomain.com:5000"
    

    到您的/etc/default/docker 文件或/etc/sysconfig/docker 文件

    但最好是add your self-signed certificate/etc/docker/certs.d/myregistrydomain.com:5000/ca.crt。并重新启动您的 Docker 守护程序。
    这样,它将信任您的证书。

    请注意,Openshift origin 有一个currently open issue 1753“需要为私有 Docker 注册表注册证书的机制” 另请参阅“Can not pull image from remote node #6228”,指的是 Openshift 官方文档“Securing and Exposing the Registry”。

    【讨论】:

      猜你喜欢
      • 2020-09-20
      • 1970-01-01
      • 2016-07-18
      • 1970-01-01
      • 2017-03-31
      • 1970-01-01
      • 2019-08-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多