For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2006 > how to make http cgi-perl script work for https









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to make http cgi-perl script work for https
Krishna Prasad

2006-08-29, 4:01 am

Hi,
I an very new to CGI and want to know how to make the
CGI(with perl) pages presently working on http work on
https.

I have the following webpage Logout.cgi.

#!/opt/plat/bin/perl

use strict;
use Time::localtime;
use CGI;
use CGI::Carp 'fatalsToBrowser';
use lib "/opt/appl/web/cgi-bin";
use GS;
use Funct;

my $input = new CGI;
my $gs = GS->new();

print $input->header;

use Session;
my $sess = Session->new();
my $sessCookie = $input->cookie('session');
my $userId = undef;
my $sessId = undef;
if (defined $sessCookie)
{
($userId, $sessId) =
$sess->validateSession($sessCookie);
}

if ((not defined $userId) or (not defined $sessId))
{
&Func::DisplayAccessDeniedPage();
exit;
}

if (not defined $input->param)
{
print "<html>\n<head><title>Logout</title><link
rel='stylesheet' type='text/css'
href='/style/WorkSpace.css'></head>";
print "\n<body>";

&Funct::DisplayHeader("Logout");
&Func::BeginContentTable();

Func::DisplayInfoMessage("This will terminate your
login session, Are you sure you want to continue?");

print " <br> <center><form action='logout.cgi'
METHOD=post TARGET=_top> <input name=logout
TYPE=submit VALUE=Logout> </form></center>";

Func::EndContentTable();
Func::DisplayFooter();
}
else
{
$sess->deleteSession($userId, $sessId);

print "<html><title>Link to login screen</title>
<body onload=deleteCookie('session')><meta
http-equiv=\"refresh\" content=\"0;
URL=/cgi-in/logon.cgi\">
<script language=javascript src='/js/Validation.js'
type='text/javascript'></script> </body> </html>";
}

print $input->end_html();


Presently the above script works fine for http, when I
invoke by http://<ip address>/logout.cgi. I want to
know if any changes has to be made to the above script
to make it work with https i.e by https://<ip
address>/logout.cgi.

Also want to know if any configuration changes need to
be made in the apache web server.

Thanks in advance

Regards
Krishna

________________________________________
__________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
usenet@DavidFilmer.com

2006-08-29, 4:01 am

Krishna Pra wrote:
> Presently the above script works fine for http, when I
> invoke by http://<ip address>/logout.cgi. I want to
> know if any changes has to be made to the above script
> to make it work with https


Perl does not know or care what protocol your webserver is using.
There is nothing special you need to do to make a Perl program work via
https (Perl is completely unaware of the protocol). You do need to
properly configure your webserver, of course (but that has nothing to
do with Perl).

--
David Filmer (http://DavidFilmer.com)

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com