[Zope] HTTPSConnection Python 2.3.4

2005-03-31 Thread Joshua Jacobson




On the same machine, my 
script works in python 2.3.4 outside of zope, but it doesn't work in python 
2.3.4 within zope as an external script. There I get "sslerror: The read operation has timed 
out."
Here's the 
script:
 import httplib, 
urllib Action = '' CreateFunction = 'Create using 
Function' WLP = '123' WLPPW = '456' params = 
urllib.urlencode({'CreateFunction':CreateFunction, 'Action':Action, 'WLP':WLP, 
'WLPPW':WLPPW, 'ClientLoginId':ClientLoginID, 
'ClientPassword':'ClientPassword'}) headers = {"Content-type": 
"application/x-www-form-urlencoded", "Accept": "text/plain"}conn = 
httplib.HTTPSConnection("x..com")conn.request("POST", 
"/ClientReg.asp", params, headers) response = 
conn.getresponse() data = "">
print dataconn.close()
Why I am I 
getting different response from within Zope versus 
without?
 
Thanks,
Joshua
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] HTTPSConnection Python 2.3.4

2005-03-31 Thread Chris Withers
Step back a bit: what are you trying to do and wha tare you trying to do 
it? ;-)

Chris
Joshua Jacobson wrote:
On the same machine, my script works in python 2.3.4 outside of zope,
but it doesn't work in python 2.3.4 within zope as an external script.
There I get "sslerror: The read operation has timed out."
Here's the script:
 import httplib, urllib
 Action = 'Create'
 CreateFunction = 'Create using Function'
 WLP = '123'
 WLPPW = '456'
 params = urllib.urlencode({'CreateFunction':CreateFunction,
'Action':Action, 'WLP':WLP, 'WLPPW':WLPPW,
'ClientLoginId':ClientLoginID, 'ClientPassword':'ClientPassword'})
 headers = {"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain"}
conn = httplib.HTTPSConnection("x..com")
conn.request("POST", "/ClientReg.asp", params, headers)
 response = conn.getresponse()
 data = response.read()
print data
conn.close()
Why I am I getting different response from within Zope versus without?
 

Thanks,
Joshua


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )
--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] HTTPSConnection Python 2.3.4

2005-03-31 Thread Joshua Jacobson
Chris,

As part of my registration process on my Plone site, I need to make a
make a URL connection to a script on a remote site which returns some
information. Then I save that information in my database and email it to
the user.

Thanks,
Joshua

-Original Message-
From: Chris Withers [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 31, 2005 1:50 PM
To: Joshua Jacobson
Cc: zope@zope.org
Subject: Re: [Zope] HTTPSConnection Python 2.3.4

Step back a bit: what are you trying to do and wha tare you trying to do
it? ;-)

Chris

Joshua Jacobson wrote:

> On the same machine, my script works in python 2.3.4 outside of zope, 
> but it doesn't work in python 2.3.4 within zope as an external script.
> There I get "sslerror: The read operation has timed out."
> 
> Here's the script:
> 
>  import httplib, urllib
>  Action = 'Create'
>  CreateFunction = 'Create using Function'
>  WLP = '123'
>  WLPPW = '456'
>  params = urllib.urlencode({'CreateFunction':CreateFunction,
> 'Action':Action, 'WLP':WLP, 'WLPPW':WLPPW, 
> 'ClientLoginId':ClientLoginID, 'ClientPassword':'ClientPassword'})
>  headers = {"Content-type": "application/x-www-form-urlencoded",
> "Accept": "text/plain"}
> conn = httplib.HTTPSConnection("x..com")
> conn.request("POST", "/ClientReg.asp", params, headers)  response = 
> conn.getresponse()  data = response.read()
> 
> print data
> conn.close()
> 
> 
> Why I am I getting different response from within Zope versus without?
> 
>  
> 
> Thanks,
> 
> Joshua
> 
> 
> 
> 
> --
> --
> 
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )

--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] HTTPSConnection Python 2.3.4

2005-03-31 Thread Paul Winkler
On Thu, Mar 31, 2005 at 01:12:41PM +0200, Joshua Jacobson wrote:
> On the same machine, my script works in python 2.3.4 outside of zope,
> but it doesn't work in python 2.3.4 within zope as an external script.
> There I get "sslerror: The read operation has timed out."

I have a somewhat similar issue; an in-house Zope product is retrieving some
information from a remote URL. If I hit the same URL from the command
line on the zope server (using wget), it works fine. When Zope hits it,
it gets a Bad Gateway error from the remote (Apache + Jboss) server.
Will post back here with anything I find out, maybe it will help you.

-PW
 
-- 

Paul Winkler
http://www.slinkp.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] HTTPSConnection Python 2.3.4

2005-04-01 Thread Chris Withers
Paul Winkler wrote:
I have a somewhat similar issue; an in-house Zope product is retrieving some
information from a remote URL. If I hit the same URL from the command
line on the zope server (using wget), it works fine. When Zope hits it,
it gets a Bad Gateway error from the remote (Apache + Jboss) server.
Will post back here with anything I find out, maybe it will help you.
For both you and Jacob I'd recommend getting a packet sniffer up and 
running. It looks like the requests your python code is emitting are not 
the same as the ones that, for example, wget is emitting.

For Joshua only: are you sure the SSL server you're trying to connect to 
is alive and responding well? Do you have to do a POST or woulda GET 
suffice? If the latter, then try using urllib2 instead of httplib. Also, 
can you let us see the full traceback you get when the error occurs?

cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] HTTPSConnection Python 2.3.4

2005-04-01 Thread Paul Winkler
On Fri, Apr 01, 2005 at 08:29:39AM +0100, Chris Withers wrote:
> Paul Winkler wrote:
> >I have a somewhat similar issue; an in-house Zope product is retrieving 
> >some
> >information from a remote URL. If I hit the same URL from the command
> >line on the zope server (using wget), it works fine. When Zope hits it,
> >it gets a Bad Gateway error from the remote (Apache + Jboss) server.
> >Will post back here with anything I find out, maybe it will help you.
> 
> For both you and Jacob I'd recommend getting a packet sniffer up and 
> running. It looks like the requests your python code is emitting are not 
> the same as the ones that, for example, wget is emitting.

It'd be a heck of a lot easier if the packets were unencrypted.
I set up tcpwatch (great tool!) but predictably, for an SSL connection,
the output is gibberish. 
Any other ideas?
 
-- 

Paul Winkler
http://www.slinkp.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] HTTPSConnection Python 2.3.4

2005-04-01 Thread Tino Wildenhain
Hi,

Am Freitag, den 01.04.2005, 14:35 -0500 schrieb Paul Winkler:
> On Fri, Apr 01, 2005 at 08:29:39AM +0100, Chris Withers wrote:
> > Paul Winkler wrote:
> > >I have a somewhat similar issue; an in-house Zope product is retrieving 
> > >some
> > >information from a remote URL. If I hit the same URL from the command
> > >line on the zope server (using wget), it works fine. When Zope hits it,
> > >it gets a Bad Gateway error from the remote (Apache + Jboss) server.
> > >Will post back here with anything I find out, maybe it will help you.
> > 
> > For both you and Jacob I'd recommend getting a packet sniffer up and 
> > running. It looks like the requests your python code is emitting are not 
> > the same as the ones that, for example, wget is emitting.
> 
> It'd be a heck of a lot easier if the packets were unencrypted.
> I set up tcpwatch (great tool!) but predictably, for an SSL connection,
> the output is gibberish. 
> Any other ideas?

You might try http://www.rtfm.com/ssldump/
(also as package available for most systems)


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )