简体   繁体   English

docker 客户端 (docker 1.12/centos) http: server 给 HTTPS 客户端提供 HTTP 响应

[英]docker client (docker 1.12/centos) http: server gave HTTP response to HTTPS client

Set up docker 1.12 on centos 7. docker was started using systemd with the following commandline (according to systemctl status docker):在 centos 7 上设置 docker 1.12。 docker 是使用 systemd 和以下命令行启动的(根据 systemctl status docker):

/usr/bin/dockerd -D --tls=false --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://10.10.2.1:2376

then I want to check on the local machine, setting the following environment variables:然后我想检查本地机器,设置以下环境变量:

DOCKER_HOST=tcp://10.10.2.1:2376
DOCKER_TLS_VERIFY=0
DOCKER_MACHINE_NAME=default

Then checking with the docker commandline tool:然后使用 docker 命令行工具检查:

docker --tls=false --tlsverify=false  images

results in:结果:

An error occurred trying to connect: Get https://10.10.2.1:2376/v1.24/images/json : http: server gave HTTP response to HTTPS client尝试连接时发生错误:Get https://10.10.2.1:2376/v1.24/images/json : http: server given HTTP response to HTTPS client

Whereas a quick check:而快速检查:

curl http://10.10.2.1:2376/images/json

gives the images info.提供图像信息。

Now: I assume the server does respond to http, (which was intended), but how to get the client to talk http as well ?现在:我假设服务器确实响应了 http,(这是有意的),但是如何让客户端也与 http 通信呢?

It needs to explicitly define that your registry is not secure:它需要明确定义您的注册表不安全:

  • open /etc/docker/daemon.json file打开/etc/docker/daemon.json文件
  • add your registry to insecure-list将您的注册表添加到不安全列表
{
  ..
  "insecure-registries" : [
    "10.10.2.1:2376"
  ],
  ..
}
  • restart Docker-service重启 Docker 服务
sudo service docker restart

see for details Docker: Test an insecure registry有关详细信息,请参阅Docker:测试不安全的注册表

Port 2376 is for TLS communication.端口 2376 用于 TLS 通信。 Use port 2375 instead.请改用端口 2375。

DOCKER_HOST=tcp://10.10.2.1:2375

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 http:服务器在 Golang httptest 中对 HTTPS 客户端给出 HTTP 响应 - http: server gave HTTP response to HTTPS client in Golang httptest Argo 工件给出错误“http:服务器向 HTTPS 客户端提供 HTTP 响应” - Argo artifacts gives error "http: server gave HTTP response to HTTPS client" 收到错误“状态 400:客户端向 HTTPS 服务器发送了 HTTP 请求。” 在 IntelliJ 上连接到 Docker 时 - Getting the error “ Status 400: Client sent an HTTP request to an HTTPS server.” while connecting to Docker on IntelliJ 如何使docker客户端通过http连接到docker守护进程 - how to make docker client connect to docker daemon over http HTTP客户端-服务器请求响应 - HTTP Client-Server resquest response http-客户端服务器-请求响应-连接 - http - client server - request response - connection 如何查看与 HTTP 客户端的 HTTP/HTTPS 交互 - How to view HTTP/HTTPS Interactions with HTTP client Android:在向量中访问http服务器而不是https(Android Matrix客户端) - Android: Access http server instead of https in vector (Android Matrix client) HTTP / HTTPS客户端,HTTPS请求上的“连接重置” - HTTP/HTTPS client, “connection reset” on HTTPS requests Http Async Client无法获得响应 - Not getting response with Http Async Client
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM