WIP: TLS and other security settings

Addressing issue #1303