ReemerWeb

Twitter Cards and SSL Issues

Twitter Cards and SSL Issues

This was one of those issues that bugged me for days, until I finally found an easy fix. I had set up Twitter Cards for one of my websites, so Twitter would display links from that site in a beautiful way. But whenever I tried to validate those cards using the Twitter Card Validator, it kept giving me the same error: “Fetching the page failed because other errors”. Here’s how I fixed that!

From googling this error over and over, I quickly learnt that this probably had something to do with SSL. I’m serving all of my sites over HTTPS (as you should), but Twitter’s strict Card application was having issues with that. The solutions that I found were all a bit vague, talking about adjusting the part in Apache and other tricks. But none of them seemed to work.

After consulting my webhost, I learnt that this issue was easily fixed in the SSL settings of my webhost. When installing the certificate, I had only added the main certificate, but not all the intermediate certificates. Silly me!

At the moment of writing, I still need to figure out what intermediate certificates are or what they do, but I found out that they usually are delivered by your certificate provider in a neat bundle (like your-domain.com.ca-bundle). If you add those to your Certificate Authority Root Certificate, Twitter works like a charm.

Here’s how I did it exactly in DirectAdmin:

1. Go to your SSL-page and click on CA Root Certificate.

2. Open the file yourdomain.com.ca-bundle in a text editor and copy the contents under the certificate that’s already there.

3. Click Save.

And you’re done! Just give it a minute for the changes to process and then Twitter will recognize the correct metadata.

If this doesn’t solve your issue, you’ll find many more posts on Google about this issue with more complex solution. But maybe this issue will fix it even faster :).

Web Development
Posted on March 18, 2020, 6:42 pm