Thoughtworks Interview Question

How does HTTP and HTTPS protocols work internally?