Recaptcha not working on https

后端 未结 7 1812

i have a site in codeigniter,and that site working perfectly on http.

My client moved the site to https.

Then now when user registr

相关标签:
7条回答
  • 2020-12-18 01:42

    You need to tell the function "recaptcha_get_html()" that you want to use https. Replace recaptcha_get_html($publickey) with

    echo recaptcha_get_html($publickey,null,1);
    
    0 讨论(0)
  • 2020-12-18 01:43

    Delete "http:" from script source url.

    Change it:

    from:

    <script type="text/javascript" src="http://www.google.com/recaptcha/api.js?render=*YourPublicKey*"></script>
    

    to:

    <script type="text/javascript" src="//www.google.com/recaptcha/api.js?render=*YourPublicKey*"></script>
    
    0 讨论(0)
  • 2020-12-18 01:45

    I got the same error an tried a couple of suggestions, but nothing realy worked.

    So I logged my network traffic and analyzed it. What it shows is that mid connection the servers changed from ipv4 to ipv6 and I remembered reading somewhere that recaptcha has a problem working on ipv6.

    So I changed @fsockopen($host, [...] to @fsockopen(gethostbyname($host), [...] and recaptcha worked again.

    0 讨论(0)
  • 2020-12-18 01:45

    I got the same error an tried all suggestions but nothing work for me.

    then i did analyzed the issue and then i got SSL certificate issue

    this certificate is only valid for the following names: www.google.com (Error code: ssl_error_bad_cert_domain)

    so i changed

    echo recaptcha_get_html($publickey,,true);
    
    @fsockopen($host, [...] to @fsockopen(gethostbyname($host), [...]
    

    along with

    define("RECAPTCHA_API_SECURE_SERVER", "https://api-secure.recaptcha.net");

    to

    define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api");

    in recaptchalib.php and recaptcha worked again.

    0 讨论(0)
  • 2020-12-18 01:56

    edit recaptchalib.php like this:

    find this line - function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)

    change it to - function recaptcha_get_html ($pubkey, $error = null, $use_ssl = true)

    argument $use_ssl is changed from false to true... rest will be taken care of by the script..

    0 讨论(0)
  • 2020-12-18 01:57

    You need to change all http:// urls to https:// in "recaptchalib.php" file, after that this will work.

    0 讨论(0)
提交回复
热议问题