Reverse proxy works with SSL
New method establish_ssl to avoid duplicated code