Saturday, March 24, 2012

AddThis HTTPS SSL Support

After trying to add the AddThis widget to the codeXplode page, I had become frustrated for the lack of support that AddThis offers for SSL. They claim you can just change the url in the script tag they give you to include https. I tried that. Chrome quit displaying the widget once I did that.

Seemed kinda strange at first, but once I followed their link myself, it became obvious. Chrome tries to grab the script over https, realizes that it sees an untrusted certificate and stops (it wants you to confirm that it's ok for it to continue). If it were an actual webpage, Chrome would of course prompt you. However, this is a script, so Chrome never has the chance to prompt you. Also, you don't want users of your site being prompted to add a certificate exception before they can run some simple javascript.

My solution. Navigate to the script's secure url yourself. Select the entire script's content and copy them to a javascript file on your server. Then modify the AddThis widget's code to reference your local server file rather than the remote one. This will be more secure and you wont have to worry about whether or not their certificate is trusted - just make sure yours is lol.

The only downside is that you will have to manually update the file if AddThis makes any changes to the javascript - not really a big deal in my opinion.

No comments:

Post a Comment