[PYTHON-CRYPTO] Custom SSL verification callbacks should now work

Heikki Toivonen heikki at OSAFOUNDATION.ORG
Thu Jun 2 00:32:48 CEST 2005


Phew, this turned out to be more complicated than I originally thought.
Anyway, now you should be able to set a custom SSL verification callback
with

def verify_cb(ok, store):
    # Do my custom verification
    return ok

ctx = SSL.Context()
ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9,
verify_cb)

Previously that crashed on me every time. Both the new style callback
and the old style callback with 5 arguments are supported, and
everything should be backwards compatible. The 5 argument version is
deprecated.

I would be interested to hear if:

1) You experience any problems with this
2) You were actually using the custom callback successfully before

--
  Heikki Toivonen


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-crypto/attachments/20050601/bcddf263/attachment.pgp>


More information about the python-crypto mailing list