<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Modifying a web proxy to use SSL</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN 
class=610494620-29052007><FONT color=#0000ff>I</FONT></SPAN>'m trying to use 
twisted to proxy all web requests for a set of PCs (virtual machines actually). 
I've created my own ProxyRequest class to override the process() method so that 
it will use SSL if the URL is secure. It makes the connection and retrieves the 
data successfully, but the browser still doesn't display the HTML. I must be 
missing some other class/method that I have to override, but I'm at a loss as to 
which one at the moment.</FONT></FONT></DIV>
<P><FONT face=Arial size=2>Below is some logging from my application for the 
same page called via http and https respectively. Any help or pointers to 
working examples would be greatly appreciated!</FONT></P>
<P><FONT face=Arial size=2>Thanks,<BR>Larry Adams</FONT><FONT 
face="Times New Roman"> </FONT><BR><FONT face=Arial size=2>2007/05/29 15:10 
-0500 [SerpicoProxy,11,172.18.36.22] Starting factory 
&lt;__main__.SerpicoProxyClientFactory instance at 0xb71d8cec&gt;</FONT></P>
<P><FONT face=Arial size=2>2007/05/29 15:10 -0500 [Uninitialized] building 
protocol for addr: IPv4Address(TCP, '</FONT><A 
href="file://www.connectcommerce.com"><U></U><U></U><U><FONT face=Arial 
color=#0000ff size=2>www.connectcommerce.com</FONT></U></A><FONT face=Arial 
size=2>', 80)</FONT><FONT face="Times New Roman"><BR></FONT><FONT face=Arial 
size=2>2007/05/29 15:10 -0500 [Uninitialized] initializing 
connection</FONT><FONT face="Times New Roman"><BR></FONT><FONT face=Arial 
size=2>2007/05/29 15:10 -0500 [Uninitialized] MACHINE NAME IS 
surfsidekick</FONT><FONT face="Times New Roman"><BR></FONT><FONT face=Arial 
size=2>2007/05/29 15:10 -0500 [Uninitialized] PROXYREQUEST </FONT><A 
href="http://www.connectcommerce.com/"><U><FONT face=Arial color=#0000ff 
size=2>http://www.connectcommerce.com/</FONT></U></A><FONT 
face="Times New Roman"><BR></FONT><FONT face=Arial size=2>2007/05/29 15:10 -0500 
[Uninitialized] TRANSPORT &lt;&lt;class 'twisted.internet.tcp.Client'&gt; to 
('</FONT><A href="file://www.connectcommerce.com"><U></U><U></U><U><FONT 
face=Arial color=#0000ff size=2>www.connectcommerce.com</FONT></U></A><FONT 
face=Arial size=2>', 80) at b71d8ccc&gt;</FONT></P>
<P><FONT face=Arial size=2>2007/05/29 15:10 -0500 [Uninitialized] ISSECURE 
False</FONT><FONT face="Times New Roman"><BR></FONT><FONT face=Arial 
size=2>2007/05/29 15:10 -0500 [SerpicoProxyClient,client] Date : Tue, 29 May 
2007 20:11:27 GMT added</FONT><FONT face="Times New Roman"><BR></FONT><FONT 
face=Arial size=2>2007/05/29 15:10 -0500 [SerpicoProxyClient,client] Server : 
Apache/1.3.33 (Unix) (Gentoo/Linux) added</FONT><FONT 
face="Times New Roman"><BR></FONT><FONT face=Arial size=2>2007/05/29 15:10 -0500 
[SerpicoProxyClient,client] Location : </FONT><A 
href="http://www.connectcommerce.com/global/login.html"><U><FONT face=Arial 
color=#0000ff 
size=2>http://www.connectcommerce.com/global/login.html</FONT></U></A><FONT 
face=Arial size=2> added</FONT><FONT face="Times New Roman"><BR></FONT><FONT 
face=Arial size=2>2007/05/29 15:10 -0500 [SerpicoProxyClient,client] Connection 
: close added</FONT><FONT face="Times New Roman"><BR></FONT><FONT face=Arial 
size=2>2007/05/29 15:10 -0500 [SerpicoProxyClient,client] Content-Type : 
text/html; charset=iso-8859-1 added</FONT><FONT 
face="Times New Roman"><BR></FONT><FONT face=Arial size=2>2007/05/29 15:10 -0500 
[SerpicoProxyClient,client] trying to lose connection for transport: 
&lt;&lt;class 'twisted.internet.tcp.Client'&gt; to ('</FONT><A 
href="file://www.connectcommerce.com"><U></U><U></U><U><FONT face=Arial 
color=#0000ff size=2>www.connectcommerce.com</FONT></U></A><FONT face=Arial 
size=2>', 80) at b71d8ccc&gt;</FONT></P>
<P><FONT face=Arial size=2>2007/05/29 15:10 -0500 [SerpicoProxyClient,client] 
parent transport : &lt;SerpicoProxy #11 on 74007&gt;</FONT><FONT 
face="Times New Roman"><BR></FONT><FONT face=Arial size=2>2007/05/29 15:10 -0500 
[SerpicoProxyClient,client] Stopping factory 
&lt;__main__.SerpicoProxyClientFactory instance at 0xb71d8cec&gt;</FONT></P>
<P><FONT face=Arial size=2>2007/05/29 15:11 -0500 [SerpicoProxy,18,172.18.36.22] 
Starting factory &lt;__main__.SerpicoProxyClientFactory instance at 
0xb71d8d0c&gt;</FONT></P>
<P><FONT face=Arial size=2>2007/05/29 15:11 -0500 [Uninitialized] building 
protocol for addr: IPv4Address(TCP, '</FONT><A 
href="file://www.connectcommerce.com"><U></U><U></U><U><FONT face=Arial 
color=#0000ff size=2>www.connectcommerce.com</FONT></U></A><FONT face=Arial 
size=2>', 443)</FONT><FONT face="Times New Roman"><BR></FONT><FONT face=Arial 
size=2>2007/05/29 15:11 -0500 [Uninitialized] initializing 
connection</FONT><FONT face="Times New Roman"><BR></FONT><FONT face=Arial 
size=2>2007/05/29 15:11 -0500 [Uninitialized] MACHINE NAME IS 
surfsidekick</FONT><FONT face="Times New Roman"><BR></FONT><FONT face=Arial 
size=2>2007/05/29 15:11 -0500 [Uninitialized] PROXYREQUEST </FONT><A 
href="https://www.connectcommerce.com"><U><FONT face=Arial color=#0000ff 
size=2>https://www.connectcommerce.com</FONT></U></A><FONT 
face="Times New Roman"><BR></FONT><FONT face=Arial size=2>2007/05/29 15:11 -0500 
[Uninitialized] TRANSPORT &lt;&lt;class 'twisted.internet.tcp.TLSConnection'&gt; 
to ('</FONT><A href="file://www.connectcommerce.com"><U></U><U></U><U><FONT 
face=Arial color=#0000ff size=2>www.connectcommerce.com</FONT></U></A><FONT 
face=Arial size=2>', 443) at b71bd86c&gt;</FONT></P>
<P><FONT face=Arial size=2>2007/05/29 15:11 -0500 [Uninitialized] ISSECURE 
True</FONT><FONT face="Times New Roman"><BR></FONT><FONT face=Arial 
size=2>2007/05/29 15:11 -0500 [SerpicoProxyClient,client] Date : Tue, 29 May 
2007 20:12:00 GMT added</FONT><FONT face="Times New Roman"><BR></FONT><FONT 
face=Arial size=2>2007/05/29 15:11 -0500 [SerpicoProxyClient,client] Server : 
Apache/1.3.33 (Unix) (Gentoo/Linux) added</FONT><FONT 
face="Times New Roman"><BR><B></B></FONT><B><FONT face=Arial size=2>2007/05/29 
15:11 -0500 [SerpicoProxyClient,client] Location :</FONT></B> <A 
href="http://www.connectcommerce.com/global/login.html"><U><FONT face=Arial 
color=#0000ff 
size=2>http://www.connectcommerce.com/global/login.html</FONT></U></A><B><FONT 
face=Arial size=2> added</FONT></B><FONT face="Times New Roman"><BR></FONT><FONT 
face=Arial size=2>2007/05/29 15:11 -0500 [SerpicoProxyClient,client] Connection 
: close added</FONT><FONT face="Times New Roman"><BR></FONT><FONT face=Arial 
size=2>2007/05/29 15:11 -0500 [SerpicoProxyClient,client] Content-Type : 
text/html; charset=iso-8859-1 added</FONT><FONT 
face="Times New Roman"><BR></FONT><FONT face=Arial size=2>2007/05/29 15:11 -0500 
[SerpicoProxyClient,client] trying to lose connection for transport: 
&lt;&lt;class 'twisted.internet.tcp.TLSConnection'&gt; to ('</FONT><A 
href="file://www.connectcommerce.com"><U></U><U></U><U><FONT face=Arial 
color=#0000ff size=2>www.connectcommerce.com</FONT></U></A><FONT face=Arial 
size=2>', 443) at b71bd86c&gt;</FONT></P>
<P><FONT face=Arial size=2>2007/05/29 15:11 -0500 [SerpicoProxyClient,client] 
parent transport : &lt;SerpicoProxy #18 on 74007&gt;</FONT><FONT 
face="Times New Roman"><BR></FONT><FONT face=Arial size=2>2007/05/29 15:11 -0500 
[SerpicoProxyClient,client] Stopping factory 
&lt;__main__.SerpicoProxyClientFactory instance at 
0xb71d8d0c&gt;</FONT></P></BODY></HTML>