Tomcat如何既支持http又支持https?在server.xml中开启两个connector:
http:
- <Connector port="8080" maxHttpHeaderSize="8192"
- maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
- enableLookups="false" redirectPort="8443" acceptCount="100"
- connectionTimeout="20000" disableUploadTimeout="true"/>
https:
- <Connector port="8081" maxHttpHeaderSize="8192"
- maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
- enableLookups="false" disableUploadTimeout="true"
- acceptCount="100" scheme="https" secure="true"
- clientAuth="false" sslProtocol="TLS" keystorePass="123456" keystoreFile="d:/tomcat.keystore"/>
端口要求不一样。即http链接使用8080,https链接使用8081。