Added TLS configuration stuff (+3 options)
Improved worker thread shutdown