mxsdev / LocalSandbox

Local Azure Cloud emulator. Currently supporting Azure Service Bus.
Apache License 2.0
54 stars 2 forks source link

Invalid certificate when communicating from another Docker container #71

Open nicob21 opened 2 days ago

nicob21 commented 2 days ago

Context: I have localsandbox running in a container and I use it to run my app unit tests. When run my tests locally targeting the localsandbox container with localhost.localsandbox.sh:<PORT> it works fine.

Now I want to be able to run my tests inside a Docker container so they can run in CI. I setup my docker-compose to run a localsandbox container and another with my app and run the unit tests. Both containers are on the same Docker network.

I replaced localhost.localsandbox.sh:<PORT> by <container-name>:<PORT> in the endpoint and connection string and I get the following certificate error:

error: Hostname/IP does not match certificate's altnames: Host: service-bus. is not in the cert's altnames: DNS:localhost.localsandbox.dev, DNS:localhost.localsandbox.io, DNS:localhost.localsandbox.sh {
  "name": "RestError",
  "code": "ERR_TLS_CERT_ALTNAME_INVALID",
  "stack": "RestError: Hostname/IP does not match certificate's altnames: Host: service-bus. is not in the cert's altnames: DNS:localhost.localsandbox.dev, DNS:localhost.localsandbox.io, DNS:localhost.localsandbox.sh

Is there anything I can do to make it work? Thanks

linear[bot] commented 2 days ago

LOC-238 Invalid certificate when communicating from another Docker container