From 91fb92dfc592d4fc986f9fdffce8f49375662c3a Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Wed, 17 Apr 2024 14:01:37 -0500 Subject: [PATCH] fix: Setting the xmpp stringprep. --- jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt b/jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt index fe7b36e8d9..10cffa1fcd 100644 --- a/jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt +++ b/jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt @@ -55,6 +55,7 @@ import org.jivesoftware.smack.parsing.ExceptionLoggingCallback import org.jivesoftware.smack.provider.ProviderManager import org.jivesoftware.smackx.bytestreams.socks5.Socks5Proxy import org.jxmpp.JxmppContext +import org.jxmpp.jid.impl.JidCreate import org.jxmpp.stringprep.rocksxmppprecis.RocksXmppPrecisStringprep fun initializeSmack() { @@ -66,6 +67,9 @@ fun initializeSmack() { System.setProperty("jdk.xml.entityReplacementLimit", "0") // The default SimpleXmppStringrep is very permissive and allows some invalid JIDs that we don't want to allow. + // Force XmppStringPrepUtil to load before we override the context, otherwise it gets reverted. + // https://github.com/igniterealtime/jxmpp/pull/44 + JidCreate.from("example.com") JxmppContext.setDefaultXmppStringprep(RocksXmppPrecisStringprep.INSTANCE) SmackConfiguration.setDefaultReplyTimeout(15000)