Solved

How to check if using secure server

Posted on 2001-08-13
5
278 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 100 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

Suggested Solutions

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…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…

751 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