How do I verify an SSL certificate in python?

前端 未结 3 1982
攒了一身酷
攒了一身酷 2020-12-15 08:46

I need to verify that a certificate was signed by my custom CA. Using OpenSSL command-line utilities this is easy to do:

# Custom CA file: ca-cert.pem
# Cer         


        
3条回答
  •  孤城傲影
    2020-12-15 09:41

    Like you said, OpenSSL requires connection

    M2Crypto doesn't have good verification

    How about this ingenious idea:

    import os 
    os.system('openssl verify -CAfile ../ca-cert.pem bob.cert')
    

    Its ugly, but it works!

提交回复
热议问题