AddThis and HTTPS / SSL support – ‘Do you want to view only the webpage content that was delivered securely?’

29612v1 max 250x250 AddThis and HTTPS / SSL support   Do you want to view only the webpage content that was delivered securely?
Image via CrunchBase

Yesterday I wrote about a problem I came across using AddThis service. Today I had a new issue.

This is an example of the code generated by AddThis:


| More

It’s said what you need to do is to include it in your page and AddThis will do all the work for you. Now, it didn’t in my case…

After my fix from yesterday all worked perfect but the problem occured when HTTPS \ SSL was used on IE – I was getting the following alert:

https error AddThis and HTTPS / SSL support   Do you want to view only the webpage content that was delivered securely?

Solution

The reason for the problem was the page was delivered using secure channel (SSL) but there was a link to an external JS library (AddThis widget) which was not secure (it was referenced with http://). Again I consider that as a bug with AddThis – if they supply you with ready-to-go code it should work disregarding wheter HTTP or HTTPS is used. Google Analytics serves a dynamic code, which prevents from that issue. There’s a note on that on AddThis help, but you get there when you get issues only.

Anyhow, I followd Google Analytics approach and modified the AddThis code so it looks as below:


| More

That really works! I’m going to report that issue to AddThis authors. I hope they will make a change and nobody else has problems with that.

 AddThis and HTTPS / SSL support   Do you want to view only the webpage content that was delivered securely?

9 Responses to “AddThis and HTTPS / SSL support – ‘Do you want to view only the webpage content that was delivered securely?’”


  • Thanks for the article! I decided to implement a server-side strategy (in a PHP environment), since I use a Drupal site with page templates.

    1. In the custom page.tpl.php file, I created this function:

    function getProtocol() {
    return ($_SERVER['HTTPS']) ? (‘https://’) : (‘http://’);
    }

    2. In the addthis code block, I called this function in the final script tag:

    
    var addthis_config = {"data_track_clickback":true};
    
    Share
    |
     
     
    |
     
     
     
     
     
    
    <script type="text/javascript" src="s7.addthis.com/js/250/addthis_widget.js#username=MY_ANONYMIZED_SITE">
    
    

    Works like a charm. :)

  • HI,

    Great Information on your website I tried to solve this problem but no luck and finaly I found the solution on your website great thanks keep writing. :)

  • We have confirmed that no http calls are being made from our secure page (httpwatch), but still see this warning message when after a https ajax call is made and the page is reloaded from browser cache. Anyone experiencing this issue in IE8? Help?

  • Hi Tom,

    I am experiencing the same issue.
    I?ve looked through and adjusted the AddThis widget as per their support page here (http://www.addthis.com/help/ssl) and the security pop-up is still occurring. I?ve changed it everywhere that I possibly can ? it seems like the feature that is being called and is prompting the security pop-up is the menu pop-out feature that shows more social networking sites.

    Any luck on finding a solution for this, yet?

    Thank you

  • Hi,

    This is a great fix, thanks! Works like a charm. Only small point is the code snippet has a extra double quote, So where you have:

    4a82b6e1315a5151″‘ type

    I believe it should be

    4a82b6e1315a5151′ type

    This works for me. Thanks again!

  • Peter, I’ve checked that again (withou ttesting though) but IMHO it’s correct :)

  • Hello Jarosław

    After trying this out, I can confirm Peter is right : you do have 1 double quote too many in your example script. You have 5 double quotes and that’s no good :-(

    Adjusting this would help people in the future I’m sure.

    But a very useful tip indeed, thanks!

    Regards,
    Mike

  • Guys, if you’re showing a Twitter button and get the browser warning in IE then read this:

    http://www.addthis.com/forum/viewtopic.php?f=4&t=27082

    Due to Twitter not supporting SSL for its buttons IE raises a security warning.

  • hi,

    i did use the code given by author here, but it didnt work for me, still i am getting security alert.

    Please let me know if anything extra needs to be done.

    thanks,
    parikshit

Leave a Reply