Package org.jivesoftware.openfire.net
Class StartTlsFilter
- java.lang.Object
-
- org.apache.mina.core.filterchain.IoFilterAdapter
-
- org.jivesoftware.openfire.net.StartTlsFilter
-
- All Implemented Interfaces:
org.apache.mina.core.filterchain.IoFilter
public class StartTlsFilter extends org.apache.mina.core.filterchain.IoFilterAdapterA MINA filter that facilitates StartTLS negotiation over XMPP. When StartTLS is being negotiated, an instance ofSslFilteris added to the MINA filter-chain. However, the peer also needs to be informed that TLS negotiation can commence, as per section 5.4.2.3 of RFC-6120. To prevent race conditions, the SSL filter should be set before the peer is told to proceed. However, telling the peer to proceed with TLS negotiation needs to happen in plain text, which won't happen if an SSL filter has been set. As a work-around to this chicken/egg problem, this filter evaluates the data that is sent to the peer prior to it being passed to the SSL filter. If the data exactly matches the XMPP 'proceed' element (used to instruct the peer to begin TLS negotiation), that data skips the SSL filter. Instances of this filter are best removed from the filter-chain when TLS has been negotiated, to prevent it from evaluating all data that is being sent (which would waste system resources).- Author:
- Guus der Kinderen, guus.der.kinderen@gmail.com
- See Also:
- Section 5.4.2.3 of RFC-6120
-
-
Constructor Summary
Constructors Constructor Description StartTlsFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfilterWrite(org.apache.mina.core.filterchain.IoFilter.NextFilter nextFilter, org.apache.mina.core.session.IoSession session, org.apache.mina.core.write.WriteRequest writeRequest)
-
-
-
Method Detail
-
filterWrite
public void filterWrite(org.apache.mina.core.filterchain.IoFilter.NextFilter nextFilter, org.apache.mina.core.session.IoSession session, org.apache.mina.core.write.WriteRequest writeRequest)- Specified by:
filterWritein interfaceorg.apache.mina.core.filterchain.IoFilter- Overrides:
filterWritein classorg.apache.mina.core.filterchain.IoFilterAdapter
-
-