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. 




Monday, November 4, 2013

MacPorts trouble after Mavericks upgrade?

I was one of the early adopters for the OSX 10.9 Mavericks update on several of my machines.  As I quickly found out, however,  MacPorts updating was broken (relax, the existing binaries that were already installed by ports were running just fine).

The primary complaint by the ports installer was the lack of gnutar.  If this is your issue; read on.  Otherwise, I'm not sure if this is much use to you.

First step is: http://trac.macports.org/wiki/MavericksProblems.  There is a link to an ​installer for Mavericks.  This pertains specifically to Mac Ports 2.2.1 - if you are at that version or 2.2.0 then you should be ok to use it.  If you're at a newer Mac Ports release, then this post is probably outdated for you.  (Hint:  issuing "port version" in Terminal should tell you what version you're at).

Run the installer, and you may find that ports will start working again for new updates.  In my case, it did not.  As I updated to Mavericks, XCode became outdated.  So your next step is to download the new version of XCode via the App Store.

After getting XCode up to date, you need to run from Terminal; the command "xcodebuild -license".  In many cases, you'll need to append sudo, e.g. "sudo xcodebuild -license".

Finally,  you'll need to make sure XCode has the latest command line tools installed.  In the new version of XCode, it is not clear where to find it.  Fortunately, there's a quicker way:  "xcode-select --install" will pull up the dialog to install the latest tools.  As with xcodebuild's license step above, you will usually need to run it with "sudo".

Now, run "port selfupdate" followed by "port upgrade outdated".