added client's check of server cert and initialization of client and server options, including pinning