Mr Foo Foo
Mr Foo Foo

Reputation: 19

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?

Upvotes: 0

Views: 210

Answers (2)

powtac
powtac

Reputation: 41080

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.

Upvotes: 1

jaxb
jaxb

Reputation: 2077

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();

Upvotes: 1

Related Questions