simplify x509 material loading

address #1
Merge pull request #2 from pqwy/master

Simplify x509 material loading