Needs review
Project:
ShareThis
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Sep 2011 at 16:10 UTC
Updated:
3 May 2019 at 13:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dedisoft commentedI've added SSL support with the following modification in the sharethis.module file :
Comment #2
robloachUsing a protocol relative URL here will fix that.
Comment #3
kaerast commentedUsing a protocol relative URL doesn't fix the issue because the hostname is different - ws.sharethis.com for ssl and w.sharethis.com for non-ssl. https://w.sharethis.com will work but it gives an error due to incorrect ssl certificates.
The patch in comment one misses references to the insecure urls in stlib_picker.js.
The new multi-post widget type has problems with ssl, the direct-post widget works ok.
Finally, a reminder that you'll need to clear all your caches in order for these changes to take effect.
Comment #4
stupiddingo commentedWith one minor tweak to Rob's patch you can use a protocol-relative URL.
//ws.sharethis.com/button/buttons.js answers to both http and https.
This also works for the main ShareThis library at //ws.sharethis.com/share5x/js/stcommon.js.
Comment #5
robloachAlthough //ws.sharethis.com works, it isn't really documented on their API, so I think a check like dedisoft suggested is a good idea. Committed http://drupalcode.org/project/sharethis.git/commit/d78fd33
Comment #6.0
(not verified) commentedCorrect code display
Comment #7
temkin commentedJust adding a comment here if somebody else will have the same issue as I have right now. Current HTTPS check doesn't work if SSL is installed on a load balancer (or reverse proxy) in front of the server, but not on the server itself. In this case $_SERVER['HTTPS'] is not set and plugin serves JS from a HTTP connection, resulting in a browser warning. I'd suggest switching to a protocol relative URL, but ShareThis has different domains for a HTTP/HTTPS requests - w.sharethis.com vs ws.sharethis.com.
I don't see an ideal solution here, but for now switched to a protocol relative URL that points to a secure domain - //ws.sharethis.com/...
Comment #8
aron novakIndeed, let's add support for such proxies.
Comment #9
aron novakComment #12
jlea9378 commentedI updated my version of ShareThis to the most recent version (7.x-2.12) but I am still getting mixed content / insecure warnings on pages that have the ShareThis widget on them, as well as the site homepage:
Loading mixed (insecure) display content "http://image2.pubmatic.com/AdServer/Pug?vcode=bz0yJnR5cGU9MSZjb2RlPTMyND..." on a secure page [Learn More]
I managed to find this in the source in an iframe:
<iframe name="stSegmentFrame" width="0" height="0" id="stSegmentFrame" src="https://seg.sharethis.com/getSegment.php?purl=https%3A%2F%2Fwww.fosterclub.com%2F&jsref=https%3A%2F%2Fwww.fosterclub.com%2Fsafety-policy&rnd=1437092891329" frameborder="0" scrolling="no" style="display: none;"></iframe>It contains the following:
Buried deep within this iframe is the insecure image:
<img src="http://image2.pubmatic.com/AdServer/Pug?vcode=bz0yJnR5cGU9MSZjb2RlPTMyNDEmdGw9MTI5NjAw&u=2632FCEC-BA5E-4007-9FE1-51DDD799D5AD">How can I resolve this?
Comment #13
drupalninja99 commentedDoes drupal_add_js('//sharethis...') not work?
Comment #14
joseph.olstadHi jlea9378 , after looking through sharethis module code, it's including sharethis.com javascript in https when required, the problem likely isn't in this module, likely a problem upstream at the sharethis.com where the javascript is loaded from. At least thats what it looks like to me. There might be a way to force https for urls loaded from third party js scripts , like modify the js on the fly as its loaded from that site so that all img src is forced to https , but it might be easier just to file an issue at sharethis.com and mention this to them. I wouldn't be surprised if this is already fixed as we speak, might want to check it again, next step would be to contact sharethis.com directly I think.
Comment #15
ShareThis Support commentedHi There,
Thanks for your patience here! We've made some changes in our support organization and we're working through responding to these. We've added SSL support for Drupal module as a feature request for our team to review!
Best
ShareThis Support
Comment #16
netgeek123 commentedFeature request? Weird, should be standard... Found this document about SSL connection to Sharthis.
http://support.sharethis.com/customer/portal/articles/475097-ssl-support
Comment #17
galeaspablo commented@ShareThisSupport - SSL Support is already enabled on Drupal and all your implementations. If you had bothered to read, you would see that @jlea9378 has a problem with your code loading insecure images.
@netgeek123 this is already implemented. The problem isn't in the Drupal module. It's on their side. The problem has been reported on their support pages.
I too have this problem.
Googling for "sharethis loading insecure image" will do the trick. Here's an example of a recent report of this http://support.sharethis.com/customer/portal/questions/12990891-sharethi...
To anyone future readers, you will face intermittent issues with sharethis scripts loading insecure content, no matter what you do. Whether you use late load, or not. Even if your server is correctly configured, and you (as I have) check that the resources from sharethis are being loaded over https and through ws.sharethis.com (as they list on the instructions on their site).
This is because their scripts are loading http images / tracking pixels. Until they fix the issue that is, which they've been dismissing for years now.
-----
@ShareThisSupport When I switch to incognito/private mode, or clear all my cookies, the issue is fixed. This tells me that your (or your partners') tracking code are loading insecure images/ resources/ tracking pixels depending on the user. Hence be careful when dismissing this issue, since it might be hard to replicate.
---
My two cents. Switch away from ShareThis until this is fixed. Especially for ecommerce sites.
Comment #18
netgeek123 commentedI totally realize it was not the issue of the thread. :)
Just seems really weird that they would not fix such a small problem really.
Comment #19
galeaspablo commentedYes. It's definitely on them. Hopefully they figure it out eventually. I have a feeling that they have to get their behavior tracking partners to make changes, hence why they're slow to figure it out.
Comment #20
aoturoa commented@stupiddingo and @drupalninja99 both mentioned a working solution.
What is holding this issue back to implement a protocol relative url?
Comment #21
galeaspablo commented@aoturoa There's no patch needed. Not a module issue. The issue is that their script (loaded through https), was (and probably still is) loading http resources.
Comment #22
galeaspablo commentedComment #23
weekbeforenextI can confirm that the patch in #20 works with version 2.13 and resolves HTTPS issues with the buttons.js file. If it didn't work in the past, it's possible sharethis.com made some more recent updates to fix the issue based on the following https://www.sharethis.com/support/legacy/moving-from-http-to-https-ssl-s....
Please reconsider this change.
Comment #24
Chris Charlton+1
Comment #25
mattsmith3 commented@galeaspablo this seems pretty straightforward- why not roll this into the module?
Can one of the maintainers give this attention?
Comment #26
damienmckennaComment #27
leandro713 commentedpatch #20 works for me