<service>
태그 아래의 server.xml
파일에 적절한 커넥터를 쓰는 방법은 https를 실행하는 것입니다. 커넥터를 설정하면 http 또는 https로 서버의 모든 응용 프로그램에 액세스 할 수 있습니다. 유일한 차이점은 커넥터가 사용되는 것입니다. HTTP 및 HTTPS에 대한 일반적으로 커넥터는 다음과 같이 :
이
<Connector port="80" protocol="HTTP/1.1"
maxThreads="150" connectionTimeout="20000"
redirectPort="443"
URIEncoding="UTF-8" compression="on"/>
<Connector port="443" protocol="HTTP/1.1"
maxThreads="150" connectionTimeout="20000"
SSLEnabled="true" scheme="https" secure="true"
keystoreFile="conf/.keystore"
keystorePass="changeit"
clientAuth="false" sslProtocol="TLS"
URIEncoding="UTF-8" compression="on"/>
그런 다음 응용 프로그램을 강제 할 수
항상 이런 일을 끝 web.xml
에 transport-guarantee
태그를 추가하여 HTTPS를 사용하도록 :
<security-constraint>
<web-resource-collection>
<web-resource-name>Administrators</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Administrators</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
당신 정의한 다른 웹 리소스에 대해 transport-guarantee
을 변경할 수 있습니다. 따라서 사이트의 특정 부분을 보호하고 다른 부분은 보호 할 수 없습니다.
마지막으로 커넥터가 server.xml
인데 모든 응용 프로그램에 https를 사용하도록 강요하지 않습니다. https 커넥터 만 사용할 수 있습니다.
감사를 정의하고
<filter-mapping>
필요합니다. –이 web.xml 구성은 클라이언트 인증을 활성화할까요? 왜냐하면 server.xml 구성에서 'clientAuth = "false"'가 표시되기 때문입니다. –
클라이언트 인증은' CONFIDENTIAL transport-guarantee>'를 만들 때 적용됩니다. 클라이언트 인증없이 https를 사용할 수 있습니다. 자세한 내용은 http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html을 참조하십시오. –
rmarimon