Skip to content

Invalid certificate when communicating from another Docker container #71

@nicob21

Description

@nicob21

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions