开发者

How can I determine on the server-side when an incoming request is HTTPS?

开发者 https://www.devze.com 2023-01-09 09:25 出处:网络
Is there a HTTP environment variable I can use to work开发者_如何转开发 this out?What are you using at server side.

Is there a HTTP environment variable I can use to work开发者_如何转开发 this out?


What are you using at server side. If you are using java servlet then you can get URL information as follow:

String scheme = request.getScheme();
String serverName = request.getServerName();
int portNumber = request.getServerPort();


Apache sets an HTTPS environment variable to the value 1 or "on" when the request was made trough SSL. Note that this flag is not present on simple HTTP requests.

0

精彩评论

暂无评论...
验证码 换一张
取 消