code: def verify_cb(conn, cert, errnum, depth, ok):
      
      if not ok:
          raise SecurityError("Could not verify CA certificate {0}"
                              .format(cert.get_subject()))
      return ok
docs: The default OpenSSL certificate verification callback.