Reputation:
My site is using Google reCAPTCHA control but I am hearing its being block in China, Is there anyway around this I see there is some people reporting that changing the API to https://www.recaptcha.net works in China?
Anyone try this because I see it still going out to google?
string apiUrl = "https://www.recaptcha.net/recaptcha/api/siteverify?secret={0}&response={1}";
Upvotes: 21
Views: 29135
Reputation: 1
Google's reCAPTCHA service will load a script from https://www.gstatic.cn instead of https://www.gstatic.com In my case CSP blocks gstatic.cn so reCAPTCHA do not work in China.
Upvotes: -1
Reputation: 1
Change https://www.google.com/recaptcha/api.js To https://www.recaptcha.net/recaptcha/api.js
It works well for me
Upvotes: 0
Reputation: 773
As google says in his assistance page, you should use this domain "www.recaptcha.net" instead "www.google.com" on the api call.
Obtained from: https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally
Edit: to clarify on some of the comments, while if you try it outside of china yes you do get references to gstatic.com
but if you try this in china, any references to gstatic.com
are replaced with gstatic.cn
(don't forget to add it to your SCP). So this solution is still valid.
Upvotes: 20
Reputation: 962
I have shared the solution to this problem by using cURL.
https://stackoverflow.com/a/63568516/11910869
cURL acts as a middle man between the client and the server. So even if google.com/recaptcha can not be accessed by the client because it is blocked by the service provider, cURL can act as the proxy to send the HTTP requests and get the response.
Upvotes: 1
Reputation: 3545
IMHO, google things are not stable in China as it can be blocked anytime. From Baidu threads, it also mentioned that sometime google recaptcha works, sometime it doesn't. https://www.v2ex.com/t/492752 (Chinese)
In programming world ,unstable function means useless or more code for dealing with exception.
If you really need to use google recaptcha, you would better test properly using VPN (IP in China) first.
Here are some options you can consider,
You can use alternative captcha
Google will tell you various captcha.
Build your own captcha
Open Source Invisible reCAPTCHA alternatives
Upvotes: 7