title: Spring boot Disable response when https port is hit with http request
body: <p>I have a spring boot application in which tomcat is listening on port 8000 over HTTPS. However, when port 8000 is hit with plain http request, the server responds with  http 400.</p>
  
  <pre><code>Bad Request
  This combination of host and port requires TLS.
  </code></pre>
  
  <p>Is there a way to prevent this? I don't want server to send any response when <a href="http://localhost:8000" rel="noreferrer">http://localhost:8000</a> is requested. Spring boot and tomcat versions are as below:</p>
  
  <pre><code>sprint-boot v2.0.0.RELEASE
  tomcat v8.5.28
  </code></pre>
  
  <p>Update: application.properties is as below</p>
  
  <pre><code>server.port=8000
  server.ssl.enabled=true
  server.ssl.key-alias=alias
  server.ssl.key-store=classpath:key.jks
  server.ssl.key-store-type=JKS
  server.ssl.key-store-password=&lt;password&gt;
  server.ssl.key-password=&lt;password&gt;
  </code></pre>