Created
July 2, 2013 01:31
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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