Spring Boot Login Redirect 302 Losing HTTPS

Upon login attempt in a SpringBoot app using custom login page, the webapp automatically switches from HTTPS to HTTP. I want to allow both, but it shouldn't switch out of HTTPS automatically if it was already there. See Chrome log here:

-- General

-- Response Headers:

I'm using WebSecurityConfigurerAdapter, my configure(HttpSecurity http):


My /login page is quite simple:

<form method="post" enctype="application/x-www-form-urlencoded">
     <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
     <input type="text" name="username">
     <input type="password" name="password">
     <input id="signInBtn" type="submit" value="Sign In">

Anyone know how I can fix the configuration?