0

Under Windows, I have a software running into a docker image, this one need access to my localhost machine, on another API.

Let's say that I have a local CDN service locally running (not in a docker image)

https://localhost:44359/cdn/e_76372856-f7a0-49cc-d3d9-39f5ad58ad6d/653d147084637b2af68b39f5b0733359.jpg

So, the software in the container needs access to "localhost", the localhost outside the docker image.

Noticed that my local server use SSL, then the container has to access the resource:

https://host.docker.internal:44359/cdn/e_76372856-f7a0-49cc-d3d9-39f5ad58ad6d/653d147084637b2af68b39f5b0733359.jpg

And I got the following error message:

SSL certificate problem: unable to get local issuer certificate

PS: my localhost=192.168.65.1

I have tried several kinds of stuff, like:

1 - create a network

docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 dockernet
docker run -d --network dockernet -p 8080:8080 jolibrain/deepdetect_cpu

2 - use loopback names, like:

host.docker.internal
docker.for.win.localhost
host.docker.internal
10.0.0.2

3 - tried to use --network host, but then the container failed to start

ClubberLang
  • 1,624
  • 3
  • 21
  • 45
  • An `SSL certificate problem` message suggests the TCP-level networking (the things you can control with Docker options) is working correctly, but something at the TLS level doesn't match up (you don't have the CA certificate matching the server cert; the server cert is issued for `localhost` but you're actually connecting to `host.docker.internal`). – David Maze Jul 11 '20 at 15:55
  • The certificate is a development-signed certificate, not sure that there is a difference. Just a detail, I'm try to connect FROM the container (not TO the container). – ClubberLang Jul 11 '20 at 15:57

0 Answers0