Google reCAPTCHA in China

user5843610 picture user5843610 · Sep 6, 2019 · Viewed 14.1k times · Source

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}";

enter image description here

Answer

Arm144 picture Arm144 · Sep 9, 2019

As google says in his assistance page, you should use this domain "www.recaptcha.net" instead "www.google.com" on the api call.

  • First, replace src="https://www.google.com/recaptcha/api.js" with src="https://www.recaptcha.net/recaptcha/api.js"
  • After that, apply the same to everywhere else that uses "www.google.com/recaptcha/" on your site.

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.