From 92968e16304a3a4c138010580c46d2e7c8a00743 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 14 Apr 2016 22:59:22 +0200 Subject: [PATCH] Use java-pinning-java7 for the integration tests to avoid "Certificates does not conform to algorithm constraints" when using certain cert chains (e.g CACert). --- smack-integration-test/build.gradle | 2 +- .../inttest/AbstractSmackLowLevelIntegrationTest.java | 6 +++--- .../smack/inttest/SmackIntegrationTestFramework.java | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/smack-integration-test/build.gradle b/smack-integration-test/build.gradle index 1d0eda721..9141ea2ac 100644 --- a/smack-integration-test/build.gradle +++ b/smack-integration-test/build.gradle @@ -11,7 +11,7 @@ dependencies { compile project(':smack-tcp') compile project(':smack-extensions') compile 'org.reflections:reflections:0.9.9-RC1' - compile 'eu.geekplace.javapinning:java-pinning-jar:1.0.1' + compile 'eu.geekplace.javapinning:java-pinning-java7:1.1.0-alpha1' compile "junit:junit:$junitVersion" testCompile "org.jxmpp:jxmpp-jid:$jxmppVersion:tests" } diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackLowLevelIntegrationTest.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackLowLevelIntegrationTest.java index cd55e824c..13e89fa55 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackLowLevelIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackLowLevelIntegrationTest.java @@ -1,6 +1,6 @@ /** * - * Copyright 2015 Florian Schmaus + * Copyright 2015-2016 Florian Schmaus * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import org.jivesoftware.smack.tcp.XMPPTCPConnection; import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration; import org.jxmpp.jid.DomainBareJid; -import eu.geekplace.javapinning.JavaPinning; +import eu.geekplace.javapinning.java7.Java7Pinning; public abstract class AbstractSmackLowLevelIntegrationTest extends AbstractSmackIntTest { @@ -47,7 +47,7 @@ public abstract class AbstractSmackLowLevelIntegrationTest extends AbstractSmack public final XMPPTCPConnectionConfiguration.Builder getConnectionConfiguration() throws KeyManagementException, NoSuchAlgorithmException { XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder(); if (configuration.serviceTlsPin != null) { - SSLContext sc = JavaPinning.forPin(configuration.serviceTlsPin); + SSLContext sc = Java7Pinning.forPin(configuration.serviceTlsPin); builder.setCustomSSLContext(sc); } builder.setSecurityMode(configuration.securityMode); diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java index 418a530d8..b63da871a 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java @@ -1,6 +1,6 @@ /** * - * Copyright 2015 Florian Schmaus + * Copyright 2015-2016 Florian Schmaus * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,7 @@ import org.reflections.scanners.MethodParameterScanner; import org.reflections.scanners.SubTypesScanner; import org.reflections.scanners.TypeAnnotationsScanner; -import eu.geekplace.javapinning.JavaPinning; +import eu.geekplace.javapinning.java7.Java7Pinning; public class SmackIntegrationTestFramework { @@ -529,7 +529,7 @@ public class SmackIntegrationTestFramework { .setSecurityMode(config.securityMode); // @formatter:on if (StringUtils.isNotEmpty(config.serviceTlsPin)) { - SSLContext sc = JavaPinning.forPin(config.serviceTlsPin); + SSLContext sc = Java7Pinning.forPin(config.serviceTlsPin); builder.setCustomSSLContext(sc); } XMPPTCPConnection connection = new XMPPTCPConnection(builder.build()); @@ -554,7 +554,7 @@ public class SmackIntegrationTestFramework { SmackException, IOException, XMPPException { XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder(); if (config.serviceTlsPin != null) { - SSLContext sc = JavaPinning.forPin(config.serviceTlsPin); + SSLContext sc = Java7Pinning.forPin(config.serviceTlsPin); builder.setCustomSSLContext(sc); } builder.setSecurityMode(config.securityMode);