Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to check if using secure server

Posted on 2001-08-13
5
Medium Priority
?
295 Views
Last Modified: 2010-03-05
How to check using perl if I am using a secure server!

I tried this:

my ($http) = split(/:/,$ENV{'SCRIPT_URI'});
if ($http eq "https") {
# Secure server
}
else {
# Normal server
}

But this will not work on a NT (Windows2000) machine because $ENV{'SCRIPT_URI'} will there return nothing!!

How to check on both systems??
0
Comment
Question by:weversbv
  • 3
5 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6381987
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6382002
0
 

Accepted Solution

by:
gixxerboy earned 400 total points
ID: 6382479
How about using $ENV{'SERVER_PORT'} ?

HTTPS servers run on port 443 instead of 80.

e.g.

if ($ENV{'SERVER_PORT'} eq "443") {
# Secure server
}
else {
# Normal server
}
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6382948
$ENV{'SERVER_URL'}
# sorry E-E was brocken a few hours ago
0
 

Author Comment

by:weversbv
ID: 6383037
$ENV{'SERVER_URL'} will give nothing on a NT (Windows2000) sever!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question