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):

http.authorizeRequests().antMatchers("/version*").permitAll().anyRequest().authenticated()
.and().formLogin().loginPage("/login").permitAll().and().logout().permitAll();

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">
</form>

Anyone know how I can fix the configuration?