added SNI support for client and server, cleanup some of the certificate verification callback code