Solved

How to check if using secure server

Posted on 2001-08-13
5
250 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Syslog text file into database or into .CSV 19 107
cpan issue 1 61
Perl DBI Transactions Using Custom Module 7 45
Matching a random pattern with one common character 2 43
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…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now