title: How to solve "The certificate is not valid and cannot be used to verify the identity of this website" error?
body: <p>The question is, <strong>How to solve "The certificate is not valid and cannot be used to verify the identity of this website" error?</strong>.</p>
  
  <p>Here are the details:</p>
  
  <p>I have a signed applet that has been working fine, until I updated Java to 8u25 (1.8.0_25-b18). Now, the application shows an alert message "Do you want to continue? The connection to this website is untrusted". There is a note in this message too, "<code>The certificate is not valid and cannot be used to verify the identity of this website</code>".</p>
  
  <p>The applet is loaded without problems. But when the user tries to use a specific function of that application, the warning message is displayed.</p>
  
  <p>I've checked the java console when this happens, and this warning message is displayed right after these lines:</p>
  
  <pre><code>security: Obtain certificate collection in SSL Root CA certificate store
  security: Invalid certificate from HTTPS server
  network: Cache entry not found [url: https://sub.domain.net:9876, version: null]
  </code></pre>
  
  <p>The application is downloaded from a different domain, say "<a href="https://app.domain.net/" rel="noreferrer">https://app.domain.net/</a>.....", so no jars are downloaded from "<a href="https://sub.domain.net:9876" rel="noreferrer">https://sub.domain.net:9876</a>", but the applet connects to "<a href="https://sub.domain.net:9876" rel="noreferrer">https://sub.domain.net:9876</a>" to send/receive data.</p>
  
  <p>The applet is signed correctly, and so far, it meets all the security requirements according to Java. This issue seems to happen when the application tries to connect internally with an HTTPS url like <code>https://sub.domain.net:9876</code>. That sites' SSL certificate is valid, issued by GoDaddy and has not expired.</p>
  
  <p>Again, this started to happen after updating my JRE to 8u25. I've tested adding the offending URL to Java security exception list, with no success.</p>
  
  <p>Here are a few screenshot of this problem:</p>
  
  <p>This is the warning message displayed:
  <img src="https://i.stack.imgur.com/fMdYC.png" alt="Warning message">
  <img src="https://i.stack.imgur.com/8XdAz.png" alt="More information about the warning message">
  <img src="https://i.stack.imgur.com/uyH4D.png" alt="Certificate basic information 1">
  <img src="https://i.stack.imgur.com/UqHKn.png" alt="Certificate basic information 2"></p>
  
  <hr>
  
  <p><strong>Edit 10/18/2014:</strong></p>
  
  <p>Question posted in "Oracle Community" too, to increase answer options:
  <a href="https://community.oracle.com/message/12684985" rel="noreferrer">Question in Oracle Community</a>.</p>
  
  <hr>
  
  <p><strong>Edit 10/21/2014:</strong></p>
  
  <p>I noticed this: When I click the link "More Information" displayed in the "Security Warning" dialog, the reason displayed says:</p>
  
  <blockquote>
    <p>The application is being downloaded from a site other than the one
    specified by the security certificate.</p>
    
    <ul>
    <li><p>Downloading from "sub.domain.net"</p></li>
    <li><p>Expecting "*.DOMAIN.NET"</p></li>
    </ul>
  </blockquote>
  
  <p>This message says the application is BEING DOWNLOADED FROM "sub.domain.com", and that is false. The application (applet) is already downloaded, and it is only using that domain in an internal HTTPS request, to get/send business data, not to download additional Jars, JNLPs, etc.</p>