http: server gave HTTP response to HTTPS client
The error message "http: server gave HTTP response to HTTPS client" occurs when a client tries to access a server through an HTTPS connection, but the server only supports HTTP. This error is commonly seen when using Docker to interact with a private registry, as Docker defaults to HTTPS communication with registries since version 1.3. There are a few ways to solve this problem, depending on the situation.
One solution is to configure Docker to use HTTP communication with the private registry. To do this, you can add the --insecure-registry
option when starting the Docker daemon. This option tells Docker to allow communication with the registry over HTTP. For example, if the private registry is hosted at ip:5000
, you can start Docker with the following command:
sudo dockerd --insecure-registry ip:5000
However, using the --insecure-registry
option is not recommended for production environments, as it disables Docker's security features. Instead, you can configure the private registry to support HTTPS communication by setting up a reverse proxy or using a tool like stunnel
to encrypt the communication.
Another solution is to configure the client to use HTTPS communication with the server, if supported. For example, if you are using kubectl
to interact with a Kubernetes cluster, you can specify the protocol to use when accessing the private registry by adding the --insecure-skip-tls-verify=false
option. This option tells kubectl
to use HTTPS communication with the registry, and to verify the server's TLS certificate.
It's worth noting that if the server does not support HTTPS communication, using HTTPS on the client side will not work. In this case, you will need to either enable HTTPS on the server or use a different tool that supports HTTP communication.
Sources:
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异