Question

I have one web application, in which one specific service needs to go through secure https, and other all service should be http, I did:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           keystoreFile="${user.home}/keystore/keystore.jks" keystorePass="test"
           truststoreFile="${user.home}/keystore/keystore.jks" truststorePass="test"      
           truststoreType="JKS" disableUploadTimeout="true"   
           enableLookups="true" maxHttpHeaderSize="8192" 
           maxSpareThreads="75" minSpareThreads="25"
           clientAuth="true" sslProtocol="TLS" />

but it expects every service as https, is their a way I can configure tomcat which fulfill my requirement?

Was it helpful?

Solution

You can run both both HTTP and HTTPS on same server, just add another connector for http.

<Connector port="80" protocol="HTTP/1.1"
           maxThreads="150" 
           disableUploadTimeout="true"   
           enableLookups="true" maxHttpHeaderSize="8192" 
           maxSpareThreads="75" minSpareThreads="25" />

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           keystoreFile="${user.home}/keystore/keystore.jks" keystorePass="test"
           truststoreFile="${user.home}/keystore/keystore.jks" truststorePass="test"      
           truststoreType="JKS" disableUploadTimeout="true"   
           enableLookups="true" maxHttpHeaderSize="8192" 
           maxSpareThreads="75" minSpareThreads="25"
           clientAuth="true" sslProtocol="TLS" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top