Jetpack could not connect: SSL certificate problem

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 to enable the features of the plugin. Unfortunately, clicking on the “connect to” button brought up the error message below –

Wordpress Jetpack SSL error

Jetpack could not contact 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', '' );


defined( 'JETPACK__API_BASE' ) or define( 'JETPACK__API_BASE', '' );

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 in place of, 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.

10 Responses to “Jetpack could not connect: SSL certificate problem”

  1. Ali Syme (@alisyme) Says:

    Really helpful! This was bigging me for a while and I couldn’t get a clear fix from the WordPress forums.

  2. Janice Says:

    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.

  3. osblues Says:

    No problem, glad it was useful.

  4. jmprosper Says:

    great help ! i’ve been battling with this for ages !

  5. mffun Says:

    thank you!!!

  6. eatnapplay Says:

    Thanks so much for this post! It was a huge help!

  7. dawesi Says:

    gold, thanks. must be something to do with loaded php libs, or lack of.

  8. mhassan Says:

    works great, thank you

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: