开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜