title: Spring Boot - I have configured HTTPS using Self Sign Certificate and running properly on HTTPS. But I want to configure HTTP for API rest on HTTPS?
body: <p>//Createing tomcat server object</p>
  <pre><code>       @Bean
         public ServletWebServerFactory servletContainer() {
         TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory() {
         @Override
      protected void postProcessContext(Context context) {
              SecurityConstraint securityConstraint = new SecurityConstraint()
              securityConstraint.setUserConstraint(USER_CONSTRAINT)
              SecurityCollection collection = new SecurityCollection()
              collection.addPattern(&quot;/*&quot;)
              securityConstraint.addCollection(collection);
              context.addConstraint(securityConstraint);
              }
          };
         tomcat.addAdditionalTomcatConnectors(redirectConnector());
         return tomcat;
      }
  </code></pre>
  <p>//Here is a redirec connector</p>
  <pre><code>    private Connector redirectConnector() {
          Connector connector = new Connector(
              TomcatServletWebServerFactory.DEFAULT_PROTOCOL);
      connector.setScheme(HTTP);
      connector.setPort(HTTP_PORT); -//This is port of http but not working
      connector.setSecure(false);
      connector.setRedirectPort(HTTPS_PORT); //This is working
      return connector;
      }
  </code></pre>
  <p>//At last my requirement is to fetch application on Https and API using swagger on http.</p>