Changeset 12e6ca8


Ignore:
Timestamp:
Dec 1, 2008 4:57:49 PM (16 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
227f558
Parents:
f92db31
Message:

Code to accept self signed certs under older M2Crypto

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/util.py

    rf92db31 r12e6ca8  
    4343            self.set_verify(SSL.verify_peer, 10)
    4444        else:
    45             self.set_verify(SSL.verify_peer, 10,
    46                 callback=SSL.cb.ssl_verify_callback_allow_unknown_ca)
     45            # More legacy code.  Recent versions of M2Crypto express the
     46            # allow_unknown_ca option through a callback turned to allow it.
     47            # Older versions use a standard callback that respects the
     48            # attribute.  This should work under both regines.
     49            callb = getattr(SSL.cb, 'ssl_verify_callback_allow_unknown_ca',
     50                    SSL.cb.ssl_verify_callback)
     51            self.set_allow_unknown_ca(True)
     52            self.set_verify(SSL.verify_peer, 10, callback=callb)
    4753
    4854def read_simple_accessdb(fn, auth, mask=[]):
Note: See TracChangeset for help on using the changeset viewer.