Separate TLS and HTTP functions.