[Zope] Accessing httplib from a Zope Python script
Scott Burton
scott@posplugin.com
Thu, 8 May 2003 14:18:42 -0700
Another couple problems you may run into... I have come across a similar
situation where I had to make an https connection from Zope. What I did
was to create a folder in bin/lib/ which contained my modules. I then
used an external method to call the modules. This worked but I started
running into some other problems.
1. The socket connection took a long time to create, like about 1
second. Which isn't good for the volume of connections we are making.
2. It is somehow tied into the Zope threads and if the connection is
taking a while and someone else executes another connection it would
completely hang Zope. I think it has to do with the user thread and it
reaching the thread limit of Zope. I have somewhat remedied this by
increasing the thread count on startup. If anyone else knows what it
could be feel free to chime in.
So, what I am attempting to do now is make all of it into a product. I
am also going to use the PThreads product to help with making it
thread-safe.
If you are using windows you can install the dll's that enable you to do
https connections from Python, if you are on a *nix box, you can enable
ssl in python on the install.
I am also interested in what you come up with. Is it going to be an
open-source module? :)
Scott Burton
-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of
Dylan Reinhardt
Sent: Thursday, March 27, 2003 1:22 AM
To: Sean Winstead
Cc: zope@zope.org
Subject: Re: [Zope] Accessing httplib from a Zope Python script
On Thu, 2003-03-27 at 15:50, Sean Winstead wrote:
> Then I receive the following error when posting to the page:
>
> Error Type: Unauthorized
> Error Value: You are not allowed to access HTTP in this context
>
Ignore the issues with your script. Your *real* problem is that PayPal
won't accept HTTP for this connection, you must use HTTPS.
Posting HTTPS from Zope is a bit more difficult, given that vanilla
Python 2.1 doesn't support SSL. What you want is a library called
M2Crypto. If you're on Windoze, you're in luck, b/c there are binaries
available... but if you're on Linux, you've got some compiling to do.
(You'll need SWIG set up before you can compile M2Crypto.)
See: http://www.zope.org/Members/dylanr/secure_post for hints on how to
proceed once you've got M2Crypto in place.
HTH,
Dylan
_______________________________________________
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 )