Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/camel-xmpp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</dependency>
<dependency>
<groupId>org.igniterealtime.smack</groupId>
<artifactId>smack-java7</artifactId>
<artifactId>smack-java8</artifactId>
<version>${smack-version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import org.apache.camel.Exchange;
import org.apache.camel.spi.HeaderFilterStrategy;
import org.apache.camel.support.DefaultHeaderFilterStrategy;
import org.apache.camel.util.ObjectHelper;
import org.jivesoftware.smack.packet.DefaultExtensionElement;
import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.StandardExtensionElement;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smackx.jiveproperties.JivePropertiesManager;
import org.jivesoftware.smackx.jiveproperties.packet.JivePropertiesExtension;
Expand Down Expand Up @@ -135,8 +136,8 @@ public Map<String, Object> extractHeadersFromXmpp(Stanza stanza, Exchange exchan
if (jpe instanceof JivePropertiesExtension) {
extractHeadersFrom((JivePropertiesExtension) jpe, exchange, answer);
}
if (jpe instanceof DefaultExtensionElement) {
extractHeadersFrom((DefaultExtensionElement) jpe, exchange, answer);
if (jpe instanceof StandardExtensionElement) {
extractHeadersFrom((StandardExtensionElement) jpe, exchange, answer);
}

if (stanza instanceof Message) {
Expand Down Expand Up @@ -165,9 +166,10 @@ private void extractHeadersFrom(JivePropertiesExtension jpe, Exchange exchange,
}
}

private void extractHeadersFrom(DefaultExtensionElement jpe, Exchange exchange, Map<String, Object> answer) {
for (String name : jpe.getNames()) {
Object value = jpe.getValue(name);
private void extractHeadersFrom(StandardExtensionElement jpe, Exchange exchange, Map<String, Object> answer) {
for (Entry<String, String> attributes : jpe.getAttributes().entrySet()) {
String name = attributes.getKey();
String value = attributes.getValue();
if (!headerFilterStrategy.applyFilterToExternalHeaders(name, value, exchange)) {
answer.put(name, value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public XmppLogger(String direction) {
@Override
public void processStanza(Stanza stanza) {
if (LOG.isDebugEnabled()) {
LOG.debug("{} : {}", direction, stanza.toXML(null));
LOG.debug("{} : {}", direction, stanza.toXML());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.camel.util.ObjectHelper;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;
import org.jivesoftware.smack.util.SslContextFactory;
import org.jxmpp.jid.impl.JidCreate;

public final class XmppTestUtil {
Expand All @@ -41,14 +42,20 @@ public static void bindSSLContextTo(Registry registry, String hostAddress, int p
keyStore.load(ObjectHelper.loadResourceAsStream("bogus_mina_tls.cer"), "boguspw".toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(keyStore);
SSLContext sslContext = SSLContext.getInstance("TLS");
SSLContext sslContext = SSLContext.getInstance("TLSv1.3");
sslContext.init(null, trustManagerFactory.getTrustManagers(), null);

ConnectionConfiguration connectionConfig = XMPPTCPConnectionConfiguration.builder()
.setXmppDomain(JidCreate.domainBareFrom("apache.camel"))
.setHostAddress(InetAddress.getByName(hostAddress))
.setPort(port)
.setCustomSSLContext(sslContext)
.setSslContextFactory(new SslContextFactory() {

@Override
public SSLContext createSslContext() {
return sslContext;
}
})
.setHostnameVerifier((hostname, session) -> true)
.build();

Expand Down
2 changes: 1 addition & 1 deletion parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
<slack-api-model-version>1.48.1</slack-api-model-version>
<slf4j-api-version>2.0.17</slf4j-api-version>
<slf4j-version>2.0.17</slf4j-version>
<smack-version>4.3.5</smack-version>
<smack-version>4.4.8</smack-version>
<smallrye-config-version>3.17.2</smallrye-config-version>
<smallrye-health-version>4.3.0</smallrye-health-version>
<smallrye-fault-tolerance-version>6.11.1</smallrye-fault-tolerance-version>
Expand Down
Loading