3

I have XM Cloud running locally in a docker container. This means with self-signed certificates.

When I use JSS to create and deploy the JSS Style guide application, I keep getting the following error when starting my JSS application on http://localhost:3000: FetchError: request to https://xmcloudcm.localhost/sitecore/api/graph/edge failed, reason: unable to verify the first certificate

enter image description here

With the built-in GraphiQL explorer on URL https://xmcloudcm.localhost/sitecore/api/graph/edge/ui I can execute GraphQL queries on the endpoint https://xmcloudcm.localhost/sitecore/api/graph/edge.

This does not work with Insomnia offline GraphQL API client, I get the following error

Insomnia error

When I disable validate certificates in the settings of Insomnia it works:

Insomnia settings

I tried to set the environment variable ENV NODE_TLS_REJECT_UNAUTHORIZED "0" in the Dockerfile for the CM server, but that did not help.

Any ideas to get this working in an docker containers based environment with self-signed certificates?

2
  • Can you include texts from your screenshots as code blocks? That helps with SEO and therefore helps others to find your question and answer.
    – Marek Musielak
    Commented Oct 13, 2022 at 10:19
  • 1
    You really should be using the docker hosted rendering host for this. Then you wouldn't get any certificate errors. Did you use the XM Cloud Starter template to create your starting repo?
    – Richard Seal
    Commented Oct 13, 2022 at 16:13

1 Answer 1

2

Ah blizz! I shouldn't set the environment variable NODE_TLS_REJECT_UNAUTHORIZED to 0 on the XM Cloud CM server (in the Docker container), but on my dev machine where I run jss start:connected. Now it works!!

1
  • Once you added NODE_TLS_REJECT_UNAUTHORIZED=0 to your environment variables did you then encounter another issue where the site displays correctly but shows errors stating that the CPD "clientKey" is required? Commented May 18, 2023 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.