Add support for other hash algorithms for cert

This still fails for sha2 based algos (e.g. sha512 or sha256), tested on
debian stale, may work on newer versions of M2Crypto.