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
Solved

How to check if using secure server

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
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…

809 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