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).
This commit is contained in:
Florian Schmaus 2016-04-14 22:59:22 +02:00
parent 0afbee55e0
commit 92968e1630
3 changed files with 8 additions and 8 deletions

View File

@ -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"
}

View File

@ -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);

View File

@ -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);