add extra logic for updating certificates, fix #1847