Skip to content

Commit 3201bf1

Browse files
committed
Merge pull request igniterealtime#586 from guusdk/OF-477_GSSAPI-SASL
OF-477: SASL requires FQHN (not XMPP domain name)
2 parents cd61957 + 9ca6e8d commit 3201bf1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/java/org/jivesoftware/openfire/net/SASLAuthentication.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,15 @@ public static Status handle(LocalSession session, Element doc)
261261
throw new SaslFailureException( Failure.INVALID_MECHANISM, "The configuration of Openfire does not contain or allow the mechanism." );
262262
}
263263

264+
// OF-477: The SASL implementation requires the fully qualified host name (not the domain name!) of this server.
265+
final String fqhn = JiveGlobals.getProperty( "xmpp.fqdn", XMPPServer.getInstance().getServerInfo().getHostname() );
266+
264267
// Construct the configuration properties
265268
final Map<String, Object> props = new HashMap<>();
266269
props.put( LocalSession.class.getCanonicalName(), session );
267270
props.put( Sasl.POLICY_NOANONYMOUS, Boolean.toString( !JiveGlobals.getBooleanProperty( "xmpp.auth.anonymous" ) ) );
268271

269-
SaslServer saslServer = Sasl.createSaslServer( mechanismName, "xmpp", session.getServerName(), props, new XMPPCallbackHandler() );
272+
SaslServer saslServer = Sasl.createSaslServer( mechanismName, "xmpp", fqhn, props, new XMPPCallbackHandler() );
270273
if ( saslServer == null )
271274
{
272275
throw new SaslFailureException( Failure.INVALID_MECHANISM, "There is no provider that can provide a SASL server for the desired mechanism and properties." );

0 commit comments

Comments
 (0)