[PYTHON-CRYPTO] Problems with M2Crypto and an Axis2 Rampart test Cert.

Kershaw, PJ (Philip) P.J.Kershaw at RL.AC.UK
Wed Mar 12 17:43:58 CET 2008


Hi all,
 
I've been testing against a Java Axis2 Rampart web service and have run into a problem parsing a test certificate.   I've cut and pasted the encoded cert string into a test script to illustrate:
 
#!/usr/bin/env python
from M2Crypto import X509
import base64
 
axisRampartCertStr = 'MIICTDCCAbUCBEbJZMQwDQYJKoZIhvcNAQEEBQAwbDELMAkGA1UEBhMCTEsxEDAOBgNVBAgTB1dlc3Rlcm4xEDAOBgNVBAcTB0NvbG9tYm8xDzANBgNVBAoTBkFwYWNoZTEQMA4GA1UECxMHUmFtcGFydDEWMBQGA1UEAxMNU2FtcGxlIENsaWVudDAgFw0wNzA4MjAwOTU0MTJaGA8yMDYyMDUyMzA5NTQxMlowbDELMAkGA1UEBhMCTEsxEDAOBgNVBAgTB1dlc3Rlcm4xEDAOBgNVBAcTB0NvbG9tYm8xDzANBgNVBAoTBkFwYWNoZTEQMA4GA1UECxMHUmFtcGFydDEWMBQGA1UEAxMNU2FtcGxlIENsaWVudDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAhjQp2NJRUrAEsPYIlg26m34O16E6WkyBWMbkSvy/FJQoNg2HSOtqF/DHmej7qqJCDtiHtdZqCTOo28cpyB3XJ0g6y23ADTy1v7qUjYieF4Bn3p9QFtyznUmKyZ6hK4CjGraYvcDgjRlnPkfeyVnNamkzJB7TVRaLkumRlxHgxm0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQBNLSbNEaGBj8GBoXWBndY3JFvblPvI2mDbtZsNiggGOCezyAufGe6RnR3s5DjR5YQqPcMiDtlskFQm4/SRN2Yh16E6l7LfsOhGQsPiPrDrci4T18pz1eDLSrtJiiBah1NdeISaD0kpoUiaNKiQiu16JCnxc8tGSw3nSPg44aLYmA=='
 
axisRampartCert = X509.load_cert_string(base64.decodestring(axisRampartCertStr),
                                                            format=X509.FORMAT_DER)
print axisRampartCert.as_text()
print "Not before time: %s" % axisRampartCert.get_not_before()
print "Not after time: %s" % axisRampartCert.get_not_after()
 
Everything looks OK with the as_text output but I get 'Bad time value' for the certificate's not after time.
 
I also tried openssl on the command line and it looks OK:
 
$ openssl x509 -inform DER -in rampart.crt -enddate
notAfter=May 23 09:54:12 2062 GMT
-----BEGIN CERTIFICATE-----
...
 
Any ideas what the problem might be?
 
Cheers,
Phil


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-crypto/attachments/20080312/575fa12d/attachment.html>


More information about the python-crypto mailing list