2

I am running Sitecore XP1 topology in docker containers. I am facing following issues :

1)I am getting SSL warning even after running init.ps1 script & generating certificates :

Identity Server SSL Warning

  1. Sitecore default Login screen is appearing, but after Login, I am getting 404 page :

Sitecore Identity Server

  1. After logging in, I am getting following page :

Launchpad URL 404 Error Page

  1. I am also getting InvalidRequestSitecoreLayoutServiceClientException while trying to navigate Rendering Host :

Rendering Host

5)Although, I am successfully able to navigate to the Site Host, without any errors :

Site Host

Could anyone please help me out, I did check CM logs, not any significant issue I noticed there, also all containers are also up & running.

Thank you.

1
  • What URL are you using to hit the Site Host (with the default Sitecore page)? Commented Nov 7, 2022 at 21:03

2 Answers 2

1

My approach is to only serve traffic to the browsers through Traefik with HTTPS only. There is an issue when redirecting from Identity Server back to Content Management during the login process. To overcome this, I have forced all connection with HTTPS only by setting up HSTS headers in CM service.

The following is my Traefik labels for CM

    labels:
    - "traefik.enable=true"
    - "traefik.http.middlewares.force-STS-Header.headers.forceSTSHeader=true"
    - "traefik.http.middlewares.force-STS-Header.headers.stsSeconds=31536000"
    - "traefik.http.routers.cm-secure.entrypoints=websecure"
    - "traefik.http.routers.cm-secure.rule=Host(`${CM_HOST}`)"
    - "traefik.http.routers.cm-secure.tls=true"
    - "traefik.http.routers.cm-secure.middlewares=force-STS-Header"
1

So, it turns out that the init.ps1 script generates the certificates using wildcard characters, which get updated in traefik -> certs folder. Due to this, I was facing the SSL issue.

To resolve this, I first removed the certificates generated by wildcard characters from the location docker\traefik\certs.

Then I followed the following steps :

  1. Copy the mkcert.exe from the docker\traefik\certs folder to the root level of your solution.

  2. Run the following commands to generate the certificates in the docker\traefik\certs folder :

mkcert -install

mkcert -cert-file docker\traefik\certs{YOUR_CD_HOSTNAME}.localhost.crt -key-file docker\traefik\certs{YOUR_CD_HOSTNAME}.localhost.key "{YOUR_CD_HOSTNAME}.localhost"

mkcert -cert-file docker\traefik\certs{YOUR_CM_HOSTNAME}.localhost.crt -key-file docker\traefik\certs{YOUR_CM_HOSTNAME}.localhost.key "{YOUR_CM_HOSTNAME}.localhost

mkcert -cert-file docker\traefik\certs{YOUR_ID_SERVER_HOSTNAME}.localhost.crt -key-file docker\traefik\certs{YOUR_ID_SERVER_HOSTNAME}.localhost.key {YOUR_ID_SERVER_HOSTNAME}.localhost"

mkcert -cert-file docker\traefik\certs{YOUR_RENDERING_HOSTNAME}.localhost.crt -key-file docker\traefik\certs{YOUR_RENDERING_HOSTNAME}.localhost.key "{YOUR_RENDERING_HOSTNAME}.localhost"

After generating these certificates, just update the certs_config.yaml file at docker\traefik\config\dynamic folder with the following content :

tls:
  certificates:
    - certFile: C:\etc\traefik\certs\{YOUR_CD_HOSTNAME}.localhost.crt
      keyFile: C:\etc\traefik\certs\{YOUR_CD_HOSTNAME}.localhost.key
    - certFile: C:\etc\traefik\certs\{YOUR_CM_HOSTNAME}.localhost.crt
      keyFile: C:\etc\traefik\certs\{YOUR_CM_HOSTNAME}.localhost.key
    - certFile: C:\etc\traefik\certs\{YOUR_ID_SERVER_HOSTNAME}.localhost.crt
      keyFile: C:\etc\traefik\certs\{YOUR_ID_SERVER_HOSTNAME}.localhost.key
    - certFile: C:\etc\traefik\certs\{YOUR_RENDERING_HOSTNAME}.localhost.crt
      keyFile: C:\etc\traefik\certs\{YOUR_RENDERING_HOSTNAME}.localhost.key 

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.