title: How to configure Spring Boot 2 to run Tomcat on two ports (HTTP and HTTPS)?
body: <p>I'm not quite sure if this is possible - all examples I find online are deprecates as e.g. the property <code>security.http.port</code> does not seem to exist today in Spring Boot 2.</p>
  
  <p>What I need is a way to run Tomcat on two ports e.g. 8443 for HTTPS and 8080 for HTTP.</p>
  
  <p>Also I'd want everything under <code>/api</code> to require HTTPS <em>except</em> <code>/api/webhooks</code> (or at least <code>/webhooks</code> as I can still change the endpoint if I wanted).</p>
  
  <p>I was imagining something like this:</p>
  
  <pre><code>@Override
  public void configure(HttpSecurity http) throws Exception {
  
      http
              .requiresChannel()
                  .antMatchers("/api/*/webhooks/**")
                      .requiresInsecure()
           .and()
              .requiresChannel()
                  .antMatchers("/**")
                      .requiresSecure() 
                  .and()
                      .exceptionHandling()
                  .and()
                      .authorizeRequests()
                          .antMatchers("/api/*/public/**", "oauth/**")
                              .permitAll()
                          .antMatchers(HttpMethod.GET, "/*", "/assets/*")
                              .permitAll()
                          .antMatchers("/api/**")
                              .authenticated();
  }
  </code></pre>
  
  <p>Can this be done? This question has a <a href="https://stackoverflow.com/questions/53963847/working-with-http-webhooks-when-https-is-required">background</a> - I am trying to accept webhook calls which are coming in as HTTP POST requests.</p>