Skip to content

Instantly share code, notes, and snippets.

@ralphbean
Created July 2, 2013 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralphbean/5906151 to your computer and use it in GitHub Desktop.
Save ralphbean/5906151 to your computer and use it in GitHub Desktop.
A script that listens to the bus and tries to tell you which certs failed to validate, and which node they originally came from.
import fedmsg
import fedmsg.config
import fedmsg.crypto
import M2Crypto.X509
config = fedmsg.config.load_config()
import logging
logging.basicConfig()
for name, endpoint, topic, msg in fedmsg.tail_messages(**config):
#if not 'wiki' in topic:
# continue
valid = fedmsg.crypto.validate(msg, **config)
certificate = msg['certificate']
cert = M2Crypto.X509.load_cert_string(certificate.decode('base64'))
CN = cert.get_subject().as_text()
print topic, valid, CN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment