fix moving cert_file when password required, fix #1881