Add more checks for copying client certificate

Add more checks for the process of client certificate as discussed with Chris.

jupiter