Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When recaptcha is added to a page which is using SSL (https) connection you get mixed content messages because recaptch is pulling js from http://api.recaptcha.net/js/recaptcha_ajax.js
There is a secure version of this javascript file here: https://www.google.com/recaptcha/api/js/recaptcha_ajax.js
Perhaps the function recaptcha_captcha could have a check for SSL before running the the drupal_add_js and then select the appropriate js file.
Comments
Comment #1
thebuckst0p CreditAttribution: thebuckst0p commentedThis needs the new php lib to be swapped in from http://code.google.com/p/recaptcha/downloads/list?q=label:phplib-Latest, then the server URLs will be correct.
Comment #2
puddyglumI just replaced
drupal_add_js('http://api.recaptcha.net/js/recaptcha_ajax.js', array('type' => 'external'));
with
drupal_add_js('https://www.google.com/recaptcha/api/js/recaptcha_ajax.js', array('type' => 'external'));
and it works fine. This seriously needs to be patched.
Comment #3
puddyglumActually, this is in the -dev build already. This is a duplicate of #1124950: reCAPTCHA uses a new HTTPS API URL
Comment #4
cutcopypaste CreditAttribution: cutcopypaste commentedI was having this issue, switched to the dev build, cleared caches etc and the ReCaptcha is still causing a 'This page has insecure content' error
Comment #5
defconjuan CreditAttribution: defconjuan commentedI had a similar issue with another JavaScript library. Here's how I fixed it: