fix bugs when handle x509_store