最近,我在使用pyOpenSSL在Ubuntu 14.04中加载证书时遇到了一个问题。它引发了一个例外,如下所示
[('asn1 encoding routines', 'c2i_ibuf', 'illegal padding'), ('asn1 encoding routines',
'asn1_template_noexp_d2i', 'nested asn1 error'), ('asn1 encoding routines',
'asn1_template_noexp_d2i', 'nested asn1 error')]
虽然我在MacOSX中试用它但效果很好。我已经重新检查了pyOpenSSL的依赖关系,它没有显示任何遗漏。我尝试了另一台Ubuntu机器。它仍然提出了同样的例外。
以下是代码段
import base64
from OpenSSL import crypto
cert_loaded = crypto.load_certificate(crypto.FILETYPE_ASN1, base64.b64decode("MIIC2TCCAkKgAwIBAgIUAEDNJce2emwOFjhCvPanu9xW9H4wDQYJKoZIhvcNAQEFBQAwgagxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRYwFAYDVQQHEw1CYXNraW5nIFJpZGdlMRIwEAYDVQQKEwlBdmF5YSBJbmMxDDAKBgNVBAsTA0dDUzEoMCYGA1UEAxMfaXBvZmZpY2UtMDBlMDA3MDc4ZDQ0LmF2YXlhLmNvbTEgMB4GCSqGSIb3DQEJARMRc3VwcG9ydEBhdmF5YS5jb20wHhcNMTMwMzE5MTkyODEyWhcNMjAwMzE5MTkyODEyWjCBqDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFjAUBgNVBAcTDUJhc2tpbmcgUmlkZ2UxEjAQBgNVBAoTCUF2YXlhIEluYzEMMAoGA1UECxMDR0NTMSgwJgYDVQQDEx9pcG9mZmljZS0wMGUwMDcwNzhkNDQuYXZheWEuY29tMSAwHgYJKoZIhvcNAQkBExFzdXBwb3J0QGF2YXlhLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApVTAvrc7MNMJZNITJTLH62FRvFIZPZ3Ay+HcmGhtuGKnNsYm9IB+F20pEQ/Xs7uU8oBa1CQA9Y7iUXVHripABSrKg6aqf4nW3+vvlpRwwVGCP5AyjGMg/oSCM0uzRyGeKdfZnAXKM8IV+n3UI7LW9GWLcDqqpfiilHK4/N1m1WMCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBiWXl66qowD0vaT/ulMVcY29dytTosf0WjzGm+O8GXp0BSn49IspLUaIUuiALW2PjEaJcSHMf/d+SauAka0Rxy4LVDS0vdNNdaEu9maMh4m3XE4OT0G0ymrBX5Zc4Sb4KBQDpnupZegNdR95r81LavXf/yHIZrcZ99A0bVUqyohg=="))
有没有人可以帮我解决这个问题?