SSL fixes

Add init function to fix scheme for secure/insecure urls and hook url outbound alter to us the https scheme if we are proxying https.