[PYTHON-CRYPTO] M2Crypto.SSL.SSLServer, handle_error should take 2 arguments
Ng Pheng Siong
ngps at POST1.COM
Thu Jul 29 17:55:07 CEST 2004
On Sat, Jul 24, 2004 at 05:30:32PM -0500, John Meinel wrote:
> I noticed that the standard SocketServer has an overrideable function
> called "handle_error", if you look in the python documentation, this
> takes 2 arguments (plus self). The SSLServer only takes one.
> [...]
> Attached is a small patch that I think fixes this problem.
Thanks. M2Crypto started with Python 1.5, so it is possible that the
handle_error interface was like that once upon a time. ;-)
> It would also be nice if the SSLError object could contain information
> about what client is connecting. That way you could figure out if there
> was a specific machine that was trying to connect and was having
> difficulty negotiating the connection.
Ah, I see error signalling is a bit mixed up. M2Crypto/SSL/Error.py says:
class SSLError(Exception): pass
whereas M2Crypto/Err.py says:
class SSLError(Exception):
def __init__(self, err, client_addr):
self.err = err
self.client_addr = client_addr
def __str__(self):
return "%s: %s: %s" % \
(m2.err_func_error_string(self.err), \
self.client_addr, \
m2.err_reason_error_string(self.err))
Should be unified, after which, the SSLError instance should carry the info
you want.
Cheers.
--
Ng Pheng Siong <ngps at netmemetic.com>
http://firewall.rulemaker.net -+- Cisco PIX & Netscreen Config Version Control
http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
More information about the python-crypto
mailing list