HTTPSConnection Python 2.3.4
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("xxxxx.xxxx.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
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("xxxxx.xxxx.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
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
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
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
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)
participants (4)
-
Chris Withers -
Joshua Jacobson -
Paul Winkler -
Tino Wildenhain