adding server certificate handling