Class ClientStanzaHandler
- Direct Known Subclasses:
WebSocketClientStanzaHandler
By default, the hostname specified in the stream header sent by clients will not be validated. When validated the TO attribute of the stream header, if present, has to match the XMPP domain of the server, in any case (subdomains are not accepted). If the value of the 'to' attribute is not valid then a host-unknown error will be returned. To enable the validation set the system property xmpp.client.validate.host to true. Both the initial stream header and the one that is sent after TLS is negotiated are validated.
- Author:
- Gaston Dombiak
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SystemProperty<Boolean>Controls if the 'to' attribute of stream headers sent by clients is validated.Fields inherited from class org.jivesoftware.openfire.net.StanzaHandler
connection, PROPERTY_OVERWRITE_EMPTY_TO, router, sasl2AuthenticationCompleted, sasl2SessionResumed, saslStatus, session, sessionCreated, startedSASL, startedTLS, usingSASL2, waitingCompressionACK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateSession(String serverName, org.xmlpull.v1.XmlPullParser xpp, Connection connection) protected org.dom4j.Namespaceprotected voidprocessIQ(org.xmpp.packet.IQ packet) Process the received IQ packet.protected voidprocessMessage(org.xmpp.packet.Message packet) Process the received Message packet.protected voidprocessPresence(org.xmpp.packet.Presence packet) Process the received Presence packet.protected booleanprocessUnknowPacket(org.dom4j.Element doc) protected voidstartTLS()protected voidtlsNegotiated(org.xmlpull.v1.XmlPullParser xpp) TLS negotiation was successful so open a new stream and offer the new stream features.protected booleanprotected booleanMethods inherited from class org.jivesoftware.openfire.net.StanzaHandler
adoptSasl2ResumedSession, closeNeverEncryptedConnection, compressClient, compressionSuccessful, createSession, deliverSasl2Features, generateFeatures, getAddress, getStreamHeader, initiateSession, isEndOfStream, isHostUnknown, isStartOfStream, isStreamManagementStanza, negotiateTLS, process, processStanza, recordClaimedIdentity, refuseStream, sasl2Successful, saslSuccessful, setSession
-
Field Details
-
VALIDATE_HOST
Controls if the 'to' attribute of stream headers sent by clients is validated. When enabled, a stream that names a domain other than the XMPP domain of the local XMPP service is refused with a host-unknown stream error.- See Also:
-
-
Constructor Details
-
ClientStanzaHandler
-
-
Method Details
-
processUnknowPacket
protected boolean processUnknowPacket(org.dom4j.Element doc) -
getNamespace
protected org.dom4j.Namespace getNamespace() -
validateHost
protected boolean validateHost() -
tlsNegotiated
protected void tlsNegotiated(org.xmlpull.v1.XmlPullParser xpp) throws org.xmlpull.v1.XmlPullParserException, IOException Description copied from class:StanzaHandlerTLS negotiation was successful so open a new stream and offer the new stream features. The new stream features will include available SASL mechanisms and specific features depending on the session type such as auth for Non-SASL authentication and register for in-band registration.- Overrides:
tlsNegotiatedin classStanzaHandler- Throws:
org.xmlpull.v1.XmlPullParserExceptionIOException
-
validateJIDs
protected boolean validateJIDs() -
createSession
protected void createSession(String serverName, org.xmlpull.v1.XmlPullParser xpp, Connection connection) throws org.xmlpull.v1.XmlPullParserException - Throws:
org.xmlpull.v1.XmlPullParserException
-
processIQ
Description copied from class:StanzaHandlerProcess the received IQ packet. RegisteredPacketInterceptorwill be invoked before and after the packet was routed.Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.
- Overrides:
processIQin classStanzaHandler- Parameters:
packet- the received packet.- Throws:
UnauthorizedException- if service is not available to sender.
-
processPresence
Description copied from class:StanzaHandlerProcess the received Presence packet. RegisteredPacketInterceptorwill be invoked before and after the packet was routed.Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.
- Overrides:
processPresencein classStanzaHandler- Parameters:
packet- the received packet.- Throws:
UnauthorizedException- if service is not available to sender.
-
processMessage
Description copied from class:StanzaHandlerProcess the received Message packet. RegisteredPacketInterceptorwill be invoked before and after the packet was routed.Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.
- Overrides:
processMessagein classStanzaHandler- Parameters:
packet- the received packet.- Throws:
UnauthorizedException- if service is not available to sender.
-
startTLS
- Throws:
Exception
-