Is it possible to include a Facebook Share button on an SSL page? Currently, the site will not load the Facebook Share button if people click Yes when questioned by the browser if they only want to view content delivered securely.

I tried changing the URL to the script defined in the facebookshare.module file from http://static.ak.fbcdn.net/connect.php/js/FB.Share to https://static.ak.fbcdn.net/connect.php/js/FB.Share , just to see if that would work. That caused a security error/warning to occur about content being blocked from an invalid security certificate. The technique of using https:// in the URL worked when trying to get the tweetbutton and linkedinbutton modules to work on an SSL page. But it did not work here.

CommentFileSizeAuthor
#7 facebookshare-1398152-7.patch951 bytesbarancekk

Comments

john.oltman’s picture

Try this:

https://s-static.ak.fbcdn.net/connect.php/js/FB.Share

(s-static.ak instead of static.ak)

Let me know if that does it.

wildlife’s picture

That seems to be it. You should probably change that in the module code because it works on both http:// and https:// pages that way.

Thanks a bunch. I'll let you know if any other issues arise with it, but I think that's all that was needed.

john.oltman’s picture

Title: Facebook Share on an SSL page? » Add support for SSL
Assigned: Unassigned » john.oltman
Category: support » feature
Priority: Major » Normal

Ok, thanks. HTTPS is slow, so rather than always use it, I'll change the module to use SSL when it detects that the page is served that way.

Changing to feature request and re-titled.

wildlife’s picture

Even better. Thanks again.

pedrop’s picture

+1

this works for me under apache2:

'<script src="' . ($_SERVER['HTTPS']=='on'?'https://ssl.connect.facebook.com/connect.php/js/FB.Share':'http://static.ak.fbcdn.net/connect.php/js/FB.Share') . '" ' .
john.oltman’s picture

Committed to 7.x branch. Will back port to 6.x when I get a chance.

barancekk’s picture

StatusFileSize
new951 bytes

Thank you guys for this module.

I created a patch file that includes similar patch as in post #5 but for 7.x-1.3 version. One difference is that I am using facebook.com page also for http connection. ('http://connect.facebook.com/connect.php/js/FB.Share').

Can you please push this patch to 7.x-1.3 as is not there?

Thank you very much
Karol

guddo’s picture

Why not src="//s-static.ak.fbcdn.net/connect.php/js/FB.Share"?