Cook 2339

Hi,

I've added the option for TLS to be optional.