[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>&nbsp;</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>&nbsp;</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>&nbsp;</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
&amp;redirectsecure; }<BR>#</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</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
&lt;&lt;"EOF";<BR>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;script=20
language=3D"JavaScript"&gt;<BR>window.location =3D=20
"https://www.mysite.com";<BR>&lt;/script&gt;<BR>&lt;/head&gt;<BR>&lt;body=
&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt;<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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>----- Original Message ----- </FONT>
<DIV><FONT face=3DArial size=3D2>From: "Dave Cole" &lt;</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>&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>To: &lt;</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>&gt;</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>&gt; I have been a long time Xitami user, but now however I am =
at a=20
impasse.<BR>&gt; Perhaps I am overlooking something.<BR>&gt; Here is my=20
problem.<BR>&gt; I have purchased Xitami Pro and installed it as per the =

instructions.<BR>&gt; I have generated my private key and created a =
Temporary=20
Untrusted<BR>&gt; Certificate.<BR>&gt; So far so Good.<BR>&gt; 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>&gt; and the little lock icon lights up showing that I am using =
a=20
secure<BR>&gt; connection.<BR>&gt; HOWEVER<BR>&gt; 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>&gt; connection.<BR>&gt; How do I prevent this =

behavior?<BR>&gt; How do I force secure connections only?<BR>&gt; Thanks =
for=20
answering.<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; =
--<BR>&gt;=20
Xitami Users Mailing List -- For Xitami support<BR>&gt; 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--