more work towards TLS support