MyBB Community Forums
[Pushed] reCaptcha not work if use SSL (HTTPS) - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+----- Forum: Pushed (https://community.mybb.com/forum-183.html)
+----- Thread: [Pushed] reCaptcha not work if use SSL (HTTPS) (/thread-161240.html)

Pages: 1 2


reCaptcha not work if use SSL (HTTPS) - martec - 2014-10-14

reCaptcha not work if use SSL (HTTPS)

Solution:
in line 141 of class_captcha.php
			$this->server = "http://www.google.com/recaptcha/api";
			$this->secure_server = "https://www.google.com/recaptcha/api";

should be:
			$this->server = "//www.google.com/recaptcha/api";
			$this->secure_server = "//www.google.com/recaptcha/api";



RE: reCaptcha not work if use SSL (HTTPS) - Eldenroot - 2014-10-14

Confirmed


RE: reCaptcha not work if use SSL (HTTPS) - Jones H - 2014-10-14

Your change would work, however it makes the secure_server variable useless. You'd also need to remove it and replace it with server instead.


RE: reCaptcha not work if use SSL (HTTPS) - Euan T - 2014-10-14

(2014-10-14, 08:11 AM)Jones H Wrote: Your change would work, however it makes the secure_server variable useless. You'd also need to remove it and replace it with server instead.

IMO that would be the best solution. 


RE: reCaptcha not work if use SSL (HTTPS) - Jones H - 2014-10-14

There was an issue about this on RedMine and Stefan decided to fix it with the secure_server variable instead of removing the protocol. I'm not 100% sure why, however we can't access RedMine atm.


RE: reCaptcha not work if use SSL (HTTPS) - helper4u - 2014-10-14

I can testify that that it is not an issue with mybb. As my recaptcha is working just fine. May be your configs?


RE: reCaptcha not work if use SSL (HTTPS) - ATofighi - 2014-10-21

This issue for CloudFlare (because your host isn't secure And you use CloudFlare SSL)
For fix, you can change line 193:
		if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
to
		if((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'))



RE: reCaptcha not work if use SSL (HTTPS) - martec - 2014-10-21

(2014-10-21, 01:00 PM)My-BB.Ir Wrote: This issue for CloudFlare (because your host isn't secure And you use CloudFlare SSL)
For fix, you can change line 193:
		if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
to
		if((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'))

thanks for information...
i will move to new VPS, so after this i will install SSL in my VPS... i think better...


RE: reCaptcha not work if use SSL (HTTPS) - martec - 2014-10-22

@My-BB.Ir i tried your solution, but not work for me...

and anime-forum.info i used Full SSL mode (cloudflare)

Quote:Full SSL  --  SSL between the visitor and CloudFlare -- visitor sees HTTPS on your site, and SSL between CloudFlare and your web server. You'll need to have your own SSL cert or self-signed cert at the very least.

[Image: 5d4O8km.png]

But problem persist...


RE: reCaptcha not work if use SSL (HTTPS) - martec - 2015-03-06

for me best solution to user that use Cloudflare SSL is use https in both:

$this->server = "https://www.google.com/recaptcha/api";
$this->secure_server = "https://www.google.com/recaptcha/api";

and for me i don´t know why not use only https in recaptcha