[Xitami] SSL on xitami Pro
Robert Gilbertson
xitami@lists.xitami.org
Sat, 15 May 2004 13:51:40 +0100
This is a multi-part message in MIME format.
------=_NextPart_000_0018_01C43A83.BFFD6CC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
An easy way would be to get your server script to find out if it is =
using a secure connection, and if not, to feed your browser a simple =
page telling it to load the secure one instead.
An example of how to do this using perl is as follows:
Insert the following line into your script, somewhere before the script =
sends any info to the browser.
Immediately after any 'use' or require' statements is a good place.
If your secure port is not 443, change the number below.
#
if ($ENV{'SERVER_PORT'} ne '443') { &redirectsecure; }
#
now insert the following procedure into the script, changing =
www.mysite.com to your own address (e.g. =
https://www.thesite.com/cgi-bin/page.pl
#
print "Content-type: text/html\n\n";
print "This is the secure page";
sub redirectsecure {
print "Content-type: text/html\n\n";
print <<"EOF";
<html>
<head>
<script language=3D"JavaScript">
window.location =3D "https://www.mysite.com";
</script>
</head>
<body>
</body>
</html>
EOF
exit;
}
#
-------------------------------------------------------------------------=
-------
----- Original Message -----=20
From: "Dave Cole" <dave@advancedzzz.com>
To: <xitami@lists.xitami.org>
Sent: Tuesday, May 11, 2004 9:35 PM
Subject: [Xitami] SSL on xitami Pro
> I have been a long time Xitami user, but now however I am at a =
impasse.
> Perhaps I am overlooking something.
> Here is my problem.
> I have purchased Xitami Pro and installed it as per the instructions.
> I have generated my private key and created a Temporary Untrusted
> Certificate.
> So far so Good.
> When I type the address in as follows https://mysite.com the security =
works
> and the little lock icon lights up showing that I am using a secure
> connection.
> HOWEVER
> If I type http://mysite.com it still displays my wbsite in a non =
secure
> connection.
> How do I prevent this behavior?
> How do I force secure connections only?
> Thanks for answering.
>=20
>=20
>=20
>=20
>=20
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
------=_NextPart_000_0018_01C43A83.BFFD6CC0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>An easy way would be to get your server =
script to=20
find out if it is using a secure connection, and if not, to feed your =
browser a=20
simple page telling it to load the secure one instead.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>An example of how to do this using perl =
is as=20
follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Insert the following line into your =
script,=20
somewhere before the script sends any info to the browser.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Immediately after any 'use' or require' =
statements=20
is a good place.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>If your secure port is not 443, change =
the number=20
below.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>#<BR>if ($ENV{'SERVER_PORT'} ne '443') =
{=20
&redirectsecure; }<BR>#</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>now insert the following procedure into =
the script,=20
changing www.mysite.com to your own address (e.g.=20
https://www.thesite.com/cgi-bin/page.pl</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>#</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>print "Content-type: =
text/html\n\n";<BR>print "This=20
is the secure page";<BR>sub redirectsecure {<BR>print "Content-type:=20
text/html\n\n";<BR>print=20
<<"EOF";<BR><html><BR><head><BR><script=20
language=3D"JavaScript"><BR>window.location =3D=20
"https://www.mysite.com";<BR></script><BR></head><BR><body=
><BR></body><BR></html><BR>EOF<BR>exit;<BR>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>#</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>
<HR>
</DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>----- Original Message ----- </FONT>
<DIV><FONT face=3DArial size=3D2>From: "Dave Cole" <</FONT><A=20
href=3D"mailto:dave@advancedzzz.com"><FONT face=3DArial=20
size=3D2>dave@advancedzzz.com</FONT></A><FONT face=3DArial =
size=3D2>></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>To: <</FONT><A=20
href=3D"mailto:xitami@lists.xitami.org"><FONT face=3DArial=20
size=3D2>xitami@lists.xitami.org</FONT></A><FONT face=3DArial=20
size=3D2>></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Sent: Tuesday, May 11, 2004 9:35 =
PM</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Subject: [Xitami] SSL on xitami=20
Pro</FONT></DIV></DIV>
<DIV><FONT face=3DArial><BR><FONT size=3D2></FONT></FONT></DIV><FONT =
face=3DArial=20
size=3D2>> I have been a long time Xitami user, but now however I am =
at a=20
impasse.<BR>> Perhaps I am overlooking something.<BR>> Here is my=20
problem.<BR>> I have purchased Xitami Pro and installed it as per the =
instructions.<BR>> I have generated my private key and created a =
Temporary=20
Untrusted<BR>> Certificate.<BR>> So far so Good.<BR>> When I =
type the=20
address in as follows </FONT><A href=3D"https://mysite.com"><FONT =
face=3DArial=20
size=3D2>https://mysite.com</FONT></A><FONT face=3DArial size=3D2> the =
security=20
works<BR>> and the little lock icon lights up showing that I am using =
a=20
secure<BR>> connection.<BR>> HOWEVER<BR>> If I type </FONT><A=20
href=3D"http://mysite.com"><FONT face=3DArial=20
size=3D2>http://mysite.com</FONT></A><FONT face=3DArial size=3D2> it =
still displays my=20
wbsite in a non secure<BR>> connection.<BR>> How do I prevent this =
behavior?<BR>> How do I force secure connections only?<BR>> Thanks =
for=20
answering.<BR>> <BR>> <BR>> <BR>> <BR>> <BR>> =
--<BR>>=20
Xitami Users Mailing List -- For Xitami support<BR>> To unsubscribe:=20
</FONT><A href=3D"http://lists.xitami.org/mailman/listinfo/xitami"><FONT =
face=3DArial=20
size=3D2>http://lists.xitami.org/mailman/listinfo/xitami</FONT></A></BODY=
></HTML>
------=_NextPart_000_0018_01C43A83.BFFD6CC0--