Re: M2Crypto.SSL.SSLServer, handle_error should take 2 arguments

Ng Pheng Siong <[email protected]>
Newsgroups gmane.comp.python.cryptography
Message-ID <[email protected]>
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 <[email protected]>

http://firewall.rulemaker.net -+- Cisco PIX & Netscreen Config Version Control
http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.