fix python 3 compatibility with x509 import