<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniel Emuze</title>
    <description>The latest articles on DEV Community by Daniel Emuze (@elphynomenon).</description>
    <link>https://dev.to/elphynomenon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3150124%2F41638755-e03c-42b1-b650-31f6162fc7d8.png</url>
      <title>DEV Community: Daniel Emuze</title>
      <link>https://dev.to/elphynomenon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/elphynomenon"/>
    <language>en</language>
    <item>
      <title>Resolving SSL Certificate Issues with Zscaler</title>
      <dc:creator>Daniel Emuze</dc:creator>
      <pubDate>Sun, 11 May 2025 13:20:42 +0000</pubDate>
      <link>https://dev.to/elphynomenon/resolving-ssl-certificate-issues-with-zscaler-4hba</link>
      <guid>https://dev.to/elphynomenon/resolving-ssl-certificate-issues-with-zscaler-4hba</guid>
      <description>&lt;p&gt;When working in environments where HTTPS traffic is intercepted and proxied by tools like Zscaler , you may encounter SSL certificate validation errors when making HTTPS requests (e.g., curl, wget, or Kubernetes API calls). This article outlines the root cause of the issue, troubleshooting steps, and solutions to resolve it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem Description
&lt;/h2&gt;

&lt;p&gt;When using tools like curl or Kubernetes resources (e.g., ConfigMap, kubectl), you may encounter errors such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl: (60) SSL certificate problem: self-signed certificate in certificate chain
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This happens because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zscaler intercepts HTTPS traffic and replaces the original server certificate with its own.&lt;/li&gt;
&lt;li&gt;The system does not trust the Zscaler root certificate, leading to SSL validation failures.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Root Cause
&lt;/h2&gt;

&lt;p&gt;Corporate proxies like Zscaler acts as a man-in-the-middle (MITM) for HTTPS traffic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zscaler decrypts outgoing HTTPS traffic from your machine.&lt;/li&gt;
&lt;li&gt;It re-encrypts the traffic using its own certificate before forwarding it to the destination server.&lt;/li&gt;
&lt;li&gt;If the Zscaler root certificate is not trusted by your system, SSL validation fails.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Solution Approaches
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Add the Zscaler Root Certificate to Your Trusted Store
&lt;/h3&gt;

&lt;p&gt;To resolve the issue, you need to add the Zscaler root certificate to your system's trusted certificate store. Follow these steps:&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 1: Export the Zscaler Root Certificate
&lt;/h4&gt;

&lt;p&gt;You can export the Zscaler root certificate using one of the following methods:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option A: From Your Browser&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your browser and navigate to any HTTPS website (e.g., &lt;a href="https://dl.k8s.io" rel="noopener noreferrer"&gt;https://dl.k8s.io&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Click the lock icon in the address bar to view the site's security information.&lt;/li&gt;
&lt;li&gt;Select "Certificate" or "Connection is secure" &amp;gt; "Certificate is valid" .&lt;/li&gt;
&lt;li&gt;In the certificate window, go to the "Certification Path" tab.&lt;/li&gt;
&lt;li&gt;Select the topmost certificate in the chain (usually the Zscaler root certificate).&lt;/li&gt;
&lt;li&gt;Click "Export" and save the certificate as a .cer file (DER or PEM format).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Option B: Using OpenSSL&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run the following command to inspect the certificate chain and extract the root certificate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openssl s_client -showcerts -connect dl.k8s.io:443 &amp;lt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for the root certificate in the output (issued by Zscaler).&lt;br&gt;
Copy the base64-encoded block of the root certificate into a file (e.g., zscaler-root-ca.crt).&lt;/p&gt;
&lt;h4&gt;
  
  
  Step 2: Add the Certificate to Your Trusted Store
&lt;/h4&gt;

&lt;p&gt;Follow these steps based on your operating system:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Linux&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Copy the certificate to the trusted certificates directory:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo cp zscaler-root-ca.crt /usr/local/share/ca-certificates/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Update the CA certificates:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo update-ca-certificates
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;For macOS&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Keychain Access application.&lt;/li&gt;
&lt;li&gt;Import the certificate:&lt;/li&gt;
&lt;li&gt;Go to File &amp;gt; Import Items and select the .cer file.&lt;/li&gt;
&lt;li&gt;Trust the certificate:&lt;/li&gt;
&lt;li&gt;Double-click the imported certificate.&lt;/li&gt;
&lt;li&gt;Expand the "Trust" section and set "When using this certificate" to "Always Trust" .&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
  
  
  Step 3: Verify the Certificate Installation
&lt;/h4&gt;

&lt;p&gt;Test the connection again to ensure the certificate is trusted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://dl.k8s.io/release/stable.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If successful, you should see the content of the file without SSL errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting Tips
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Verify Certificate Chain
&lt;/h3&gt;

&lt;p&gt;Use openssl to inspect the certificate chain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openssl s_client -showcerts -connect dl.k8s.io:443 &amp;lt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure the chain includes the Zscaler root certificate.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Check Proxy Settings
&lt;/h3&gt;

&lt;p&gt;Verify that no additional proxies are interfering with the connection. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check environment variables like HTTP_PROXY and HTTPS_PROXY.&lt;/li&gt;
&lt;li&gt;Ensure your network configuration allows direct access to external domains if needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Test with Different Networks
&lt;/h3&gt;

&lt;p&gt;If possible, test your setup on a network where Zscaler is not active (e.g., personal Wi-Fi). This helps confirm whether the issue is specific to Zscaler.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By adding the Zscaler root certificate to your trusted store, you can resolve SSL certificate validation issues in environments where Zscaler intercepts HTTPS traffic. Use the steps outlined above to ensure secure and uninterrupted communication with external services.&lt;/p&gt;

&lt;p&gt;If you encounter further issues, consult your IT department for assistance with Zscaler configurations or certificate management.&lt;/p&gt;

</description>
      <category>ssl</category>
      <category>zscaler</category>
      <category>curl</category>
      <category>certificate</category>
    </item>
  </channel>
</rss>
