Wednesday, November 6, 2013

PhpStorm7 with Github Enterprise SSL issue

If when trying to setup a remote Github repository with PhpStorm7, in Preferences (in the Version Control section), you'll run into this error: 

"Can't login: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

The error is a little cryptic, but it has to do with Java and the certificate keystore that it uses for CA certificates.  A quick solution for Mac OSX is to import the server certificate into your keystore.  The utility to use in this case is keytool (which should come included).   The full command line is:

sudo keytool -import -alias "github" -file server_certificate.cer -keystore /Library/Java/Home/lib/security/cacerts

Restart PhpStorm7 and try again.  You should see the following.
If you don't have the actual certificate file, you can obtain it by going to your Github Enteprise instance via your browser and download it.  For example, in Safari, click on HTTPS in the address bar.
Then on "Show Certificate".
Finally, drag and drop the image of a certificate to your desktop or Finder.  Import as described above with the keytool. 




No comments:

Post a Comment