title: Adding certificate for a custom (private) Maven repository in IntelliJ IDEA
body: <p>I recently set up an Artifactory repository and secured it with an SSL certificate. It's not self-signed but while most operating systems come with it pre-installed, the JRE doesn't.</p>
  
  <p>The problem is that the record containing my server in the Maven Repositories Preferences window (IntelliJ Preferences > Build, Execution, Deployment > Build Tools > Maven > Repositories) gives an error when pressing the Update button. Here's the abstract from <code>idea.log</code>:</p>
  
  <pre><code>Caused by: java.lang.RuntimeException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
      at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
      at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
      at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
      ... 57 more
  </code></pre>
  
  <p>So I tried adding our root certificate to IntelliJ's Server Certificates (IntelliJ Preferences > Tools > Server Certificates) and restarted IntelliJ, but the error remains.</p>
  
  <p>Has any one else had any problems with this before?</p>
  
  <p>Screenshot of my Preferences window:</p>
  
  <p><a href="https://i.stack.imgur.com/F5ISB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/F5ISB.png" alt="Maven Repositories Preferences"></a></p>