---
title: "配置acegi 的通道过滤器 ChannelProcessingFilter"
author: "xxtianxiaxing"
date: "2009-09-08T17:06:07Z"
tags: []
slug: "acegi-channelprocessingfilter"
draft: false
lastmod: "2009-09-08T17:06:57Z"
id: 464934
url: "https://xylonwang.iteye.com/blog/464934"
---

```java

<!-- acegi的通道过滤器 -->
	<bean id="channelProcessingFilter" class="org.springframework.security.securechannel.ChannelProcessingFilter">
		<property name="channelDecisionManager" ref="channelDecisionManager"/>
		<property name="filterInvocationDefinitionSource">
			<value>
				CONVERT_URL_TO_UPPERCASE_BEFORE_COMPARISON
				\A/web/page/login/login_name.jsp\Z=REQUIRES_SECURE_CHANNEL
				\A/j_acegi_security_check.*\Z=REQUIRES_SECURE_CHANNEL
				\A.*\Z=REQUIRES_INSECURE_CHANNEL
			</value>
		</property>
	</bean>
	
	<bean id="channelDecisionManager" class="org.springframework.security.securechannel.ChannelDecisionManagerImpl">
		<property name="channelProcessors">
			<list>
				<ref local="secureChannelProcessor"/>
				<bean class="org.springframework.security.securechannel.InsecureChannelProcessor"/>
			</list>
		</property>
	</bean>
	
	<bean id="secureChannelProcessor" class="org.springframework.security.securechannel.SecureChannelProcessor">
		<property name="entryPoint" ref="retryWithHttpsEntryPoint"/>
	</bean>
	
	<bean id="retryWithHttpsEntryPoint" class="org.springframework.security.securechannel.RetryWithHttpsEntryPoint">
		<property name="portMapper" ref="portMapper"/>
	</bean>
	
	<bean id="portMapper" class="org.springframework.security.util.PortMapperImpl">
		<property name="portMappings">
			<map>
				<entry key="8888" value="8443"></entry>
			</map>
		</property>
	</bean>

tomcat下的conf/server.xml 加入

<Connector port="8443" maxHttpHeaderSize="8192"
			   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
			   enableLookups="false" disableUploadTimeout="true" acceptCount="100"
			   scheme="https" secure="true" clientAuth="false" sslProtocol="TLS"
			   keystoreFile="tomcat.keystore" keystorePass="" keystoreType="jks"/>

dos下执行，生成代码复制到tomcat根目录
keytool -genkey -alias tomcat -keyalg RSA -keystore d:tomcat.keystore



```