Solved

How to check if using secure server

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

19 Experts available now in Live!

Get 1:1 Help Now