Improved type checking for startTLS parameters. And added more advanced SSL options.