# http: server gave HTTP response to HTTPS client (insecure registry)

**Code:** `http: server gave HTTP response to HTTPS client` · **Category:** Docker · **Seen on:** Docker

Docker spoke HTTPS to a registry that only serves plain HTTP — typically a local or lab registry.

## Meaning

Docker only uses plain HTTP for registries explicitly listed as insecure-registries (except localhost). Add the registry to daemon.json — or better, put TLS in front of it.

## Common causes

- Local/private registry running without TLS
- Registry address not in insecure-registries
- Using the wrong port (HTTP port instead of HTTPS)

## Quick fix

1. Add "insecure-registries" in daemon.json and restart Docker (lab use only)
2. Enable TLS on the registry
3. Use the HTTPS port

## Detailed fix by platform

### Docker

1. 

```bash
# /etc/docker/daemon.json (Docker Desktop: Settings → Docker Engine)
{ "insecure-registries": ["192.168.1.50:5000"] }
sudo systemctl restart docker
```


## How to diagnose

1. **Registry** — curl http://host:5000/v2/ vs https://
2. **Config** — docker info | grep -A3 'Insecure Registries'

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/docker/server-gave-http-response-to-https-client)
