How to Handle PKIX Path Building Failed Error for Self-Signed Certificates

What is the PKIX path building failed error when using self-signed certificates?
When using self-signed certificates, the PKIX path building failed error may occur if the SSL connection is broken. This error is caused by the inability to find a valid certification path to the requested target.

Why is using self-signed certificates not recommended?
Self-signed certificates are not recommended because they are not signed by a trusted certificate authority, which can cause security issues and make it difficult to establish trust between the server and the client.

How can I handle the PKIX path building failed error when using self-signed certificates?
If you still want to use self-signed certificates, you must install the root certificate for the “Local Computer” as the certificate store “My certificates” in Windows. For Linux and Mac OS, the root certificate must also be installed and the server service must be restarted. If the logger is set to DEBUG, the trusted root certificates will be issued the first time SSL is used.

How do I install the root certificate for “Local Computer” in Windows?
To install the root certificate for “Local Computer” in Windows, follow these steps:

  1. Right-Click on the certificate files and select “Install certificate”
  2. Select “Local computer” and click “Next”.
  3. Select “Trusted Root Certification Authorities” as store and click “Next”, then “Finish”.

How do I install the root certificate on macOS?
To add new root certificates on macOS, you can follow these steps:

  1. Download the certificate file: Obtain the certificate file from a trusted source and download it to your Mac.
  2. Open Keychain Access: You can find Keychain Access in the Utilities folder within the Applications folder. Alternatively, you can use Spotlight search to find it.
  3. Import the certificate: In Keychain Access, click on File > Import Items from the menu bar. Locate the certificate file and click Open. The certificate will be added to your login keychain.
  4. Trust the certificate: Once the certificate is imported, you need to trust it. Double-click on the certificate in Keychain Access to open its details. Expand the “Trust” section and set “Secure Sockets Layer (SSL)” to “Always Trust” from the drop-down menu. Close the window and enter your password to confirm the changes.

How do I install the root certificate on Linux?
To add new root certificates on Debian based Linux distributions, you can follow these steps:

  1. Download the certificate file: Obtain the certificate file from a trusted source and download it to your Linux system.

  2. Copy the certificate to the trusted certificate store: Open a terminal window and enter the following command to copy the certificate to the system’s trusted certificate store:

    • sudo cp <certificate_file> /usr/local/share/ca-certificates/
      
    • Replace <certificate_file> with the full path and filename of the certificate file you downloaded.
  3. Update the trusted certificate store: Enter the following command to update the trusted certificate store with the new certificate:

    • sudo update-ca-certificates
      
    • This command will read the contents of the /usr/local/share/ca-certificates/ directory and update the trusted certificate store accordingly.

How do I restart the server service after installing the root certificate?
To restart the server service after installing the root certificate, you can use either the system specific tools to restart the server or go to Configuration > Webserver category and restart the server there.

What should I do if I still encounter issues after installing the root certificate?
If you continue to experience issues after installing the root certificate, consider using a trusted certificate authority to obtain a valid SSL certificate. This will ensure that the SSL connection is secure and can be trusted by the client.