Earlier today I stumbled across the popular Jetpack plugin for WordPress while configuring a self hosted installation for a client. Installing the plugin went fine, but once installed it then asks you to connect your site with wordpress.com to enable the features of the plugin. Unfortunately, clicking on the “connect to wordpress.com” button brought up the error message below –
Jetpack could not contact WordPress.com: token_http_request_failed. This usually means something is incorrectly configured on you web host. SSL certificate problem: self signed certificate in certificate chain
Now that error message isn’t particularly helpful, particularly if, as in this instance, the site wasn’t using SSL at all. I googled the error and found this support page on the wordpress forums, only to then discover it’s not resolved.
After more googling I found this post which indicated it might be something to with the jetpack/wordpress SSL certificate rather than that of the wordpress install we’re using.
So, between those two posts I decided to try hacking jetpack.php as mentioned in the wordpress forum post, which as the poster suggests, seems to fix the problem. While wordpress are silent on what the actual resolution is for this, I can confirm that changing –
defined( 'JETPACK__API_BASE' ) or define( 'JETPACK__API_BASE', 'https://jetpack.wordpress.com/jetpack.' );
defined( 'JETPACK__API_BASE' ) or define( 'JETPACK__API_BASE', 'http://jetpack.wordpress.com/jetpack.' );
in jetpack.php does indeed seem to fix things.
I wouldn’t claim to be an expert on SSL, but I think this may be down to how WordPress have decided to use Jetpack.me in place of jetpack.wordpress.com, but not updated the SSL certificate to reflect this. I may, of course be barking up the wrong tree there.
Only time will tell if that causes any issues further down the road.
March 16, 2013 at 1:00 pm
[…] https://osblues.com/2013/01/23/jetpack-could-not-connect-ssl-certificate-problem/ […]
March 19, 2013 at 5:10 pm
Really helpful! This was bigging me for a while and I couldn’t get a clear fix from the WordPress forums.
March 19, 2013 at 5:10 pm
April 26, 2013 at 9:51 pm
This was exactly what we needed. Thank you so much. After making the change and the connection we changed the code back and all seems to be well.
April 26, 2013 at 10:02 pm
No problem, glad it was useful.
May 10, 2013 at 6:58 am
great help ! i’ve been battling with this for ages !
May 18, 2013 at 8:23 am
June 21, 2013 at 5:28 pm
Thanks so much for this post! It was a huge help!
June 27, 2013 at 6:48 am
gold, thanks. must be something to do with loaded php libs, or lack of.
August 27, 2013 at 6:39 pm
works great, thank you