Search code examples
ddev

Corporate network VPN: `ddev composer create` results in "ssl certificate problem: self-signed certificate"


I'm running ddev under wsl2. I'm behind the zscaler proxy. I was able to copy the zscaler cert to ubuntu "/usr/local/share/ca-certificates" and ran "sudo update-ca-certificates". After that i was able to install homebrew and ddev. However, when i created the drupal 9 site and use the command "ddev composer create "drupal/recommended-project" --no-install", it gave me "ubuntu curl: (60) ssl certificate problem: self signed certificate in certificate chain". I also tried to copy the zscaler cert into the web container but still got the same issue. How do I circumvent this issue?


Solution

    1. Export proxy zscaler and certadmin certificates from Windows Trusted CA to .CER format in my network environment.

    2. Use OpenSSl and convert them from .CER to .CRT format.

      • openssl x509 -inform DER -in zscaler.cer -out zscaler.crt
      • openssl x509 -inform DER -in certadmin.cer -out certadmin.crt
    3. Copy these files to /usr/local/share/ca-certificates folder in ubuntu.

      sudo cp /mnt/c/certificates/zscaler.crt /mnt/c/certificates/certadmin.crt /usr/local/share/ca-certificates

    4. Run

      sudo update-ca-certificates

    5. Follow instructions on DDEV documentation site to install Homebrew, gcc, ddev, and xdg-utils.

    6. Again follow instructions on DDEV documentation site to setup drupal 9 project.

    7. Before running the step: ddev start, copy the certs in step #3 to my sampleprojectfolder/.ddev/web-build folder.

      cd /home/kevin/my-drupal9-site/.ddev/web-build && sudo cp /mnt/c/certificates/zscaler.crt /mnt/c/certificates/certadmin.crt .
      
    8. While cd into web-build folder, copy the sample docker file from it and name it "Dockerfile".

      cp Dockerfile.example Dockerfile

    9. Modify the content of the Dockerfile nano Dockerfile as follow so that when ddev creates the containers it pulls in the certificates into the web container as well.

      COPY *.crt /usr/local/share/ca-certificates/
      RUN update-ca-certificates --fresh
      
    10. Run

      ddev start

    11. Follow the rest of the steps to create the drupal 9 project from the DDEV Documentation.