Figure out the scheme separately from home_url(), which returns the wrong protocol on wp-login.php page over SSL.