1. Refine code. 2. Add certificate chain.