c# - How to make Microsoft.Web.Helpers.ReCaptcha work with X-Forwarded-Proto -
c# - How to make Microsoft.Web.Helpers.ReCaptcha work with X-Forwarded-Proto -
we using asp.net web helpers library 3.2.2 (nuget link) developing web app run on amazon behind elastic load balancer (elb).
it looks requests beingness sent between elb , web server unencrypted. causes context.request.issecureconnection false.
as far browser concerned request secure, shows https:// , goes through port 443 expected.
the next code in web helpers library causes browser warnings/error when it's expecting secure connection resources.
urlbuilder urlbuilder = new urlbuilder(context.request.issecureconnection ? "https://www.google.com/recaptcha/api" : "http://www.google.com/recaptcha/api");
question: if can this? without replacing recaptcha helper home-grown 1 there can forcefulness context.request.issecureconnection true when it's secure connection between browser , elb?
we utilize context.request.headers["x-forwarded-proto"]
determine if it's on secure connection in other places have command over.
just have render embed code string , manipulate string alter url if proto header included (or blanket set https).
c# asp.net-mvc amazon-ec2 recaptcha amazon-elb
Comments
Post a Comment