.NET Recaptcha https

后端 未结 3 967
南旧
南旧 2021-01-05 07:42

We\'ve started using the ASP.NET recaptcha control and it works fine. but one of the requirements we have is that all outbound traffic goes over Https.

I know that r

相关标签:
3条回答
  • 2021-01-05 08:11

    If you check out http://recaptcha.net/apidocs/captcha/client.html it says:

    "In order to avoid getting browser warnings, if you use reCAPTCHA on an SSL site, you should replace http://api.recaptcha.net with https://api-secure.recaptcha.net."

    So clearly recaptcha supports HTTPS submissions. Does the ASP.NET control have any properties you can configure the outbound URL? At worst you might need to use Reflector to examine the code and see how it's built.

    0 讨论(0)
  • 2021-01-05 08:15

    The .NET library does not require any configuration to work on HTTPS environment. It will derive from the current HttpContext whether the request is made from HTTPS protocol.

    But, there is RecaptchaControl.OverrideSecureMode property that you can use just in case it doesn't work as expected. Set to True to force HTTPS mode.

    Update:

    I seem to have misunderstood the question. I am afraid there is no HTTPS endpoint for reCAPTCHA verification (between your server and theirs).

    0 讨论(0)
  • 2021-01-05 08:16

    We are using the reCAPTCHA plugin for .NET, and we needed to do two things to get it working over SSL in our environment. Our dev environment does not use SSL, and our test and production environments do.

    1. Set the RecaptchaControl.OverrideSecureMode property to true, as Adrian Godong mentioned in his original answer to this question. This allowed the control to work locally and in dev not using SSL, and in test and prod using SSL.

      <recaptcha:RecaptchaControl
          OverrideSecureMode="True"
          ID="recaptcha"
          runat="server"
          Theme="blackglass"
          />
      
    2. When we generated the public and private keys, we specified global keys. This allowed us to use recaptcha in all of our different environments (local, dev.mydomain.com, test.mydomain.com and mydomain.com) and fixed the "input error: invalid referrer" error.

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