mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 05:52:06 +01:00
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:
parent
0afbee55e0
commit
92968e1630
3 changed files with 8 additions and 8 deletions
|
@ -11,7 +11,7 @@ dependencies {
|
||||||
compile project(':smack-tcp')
|
compile project(':smack-tcp')
|
||||||
compile project(':smack-extensions')
|
compile project(':smack-extensions')
|
||||||
compile 'org.reflections:reflections:0.9.9-RC1'
|
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"
|
compile "junit:junit:$junitVersion"
|
||||||
testCompile "org.jxmpp:jxmpp-jid:$jxmppVersion:tests"
|
testCompile "org.jxmpp:jxmpp-jid:$jxmppVersion:tests"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2015 Florian Schmaus
|
* Copyright 2015-2016 Florian Schmaus
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;
|
||||||
import org.jxmpp.jid.DomainBareJid;
|
import org.jxmpp.jid.DomainBareJid;
|
||||||
|
|
||||||
import eu.geekplace.javapinning.JavaPinning;
|
import eu.geekplace.javapinning.java7.Java7Pinning;
|
||||||
|
|
||||||
public abstract class AbstractSmackLowLevelIntegrationTest extends AbstractSmackIntTest {
|
public abstract class AbstractSmackLowLevelIntegrationTest extends AbstractSmackIntTest {
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public abstract class AbstractSmackLowLevelIntegrationTest extends AbstractSmack
|
||||||
public final XMPPTCPConnectionConfiguration.Builder getConnectionConfiguration() throws KeyManagementException, NoSuchAlgorithmException {
|
public final XMPPTCPConnectionConfiguration.Builder getConnectionConfiguration() throws KeyManagementException, NoSuchAlgorithmException {
|
||||||
XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();
|
XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();
|
||||||
if (configuration.serviceTlsPin != null) {
|
if (configuration.serviceTlsPin != null) {
|
||||||
SSLContext sc = JavaPinning.forPin(configuration.serviceTlsPin);
|
SSLContext sc = Java7Pinning.forPin(configuration.serviceTlsPin);
|
||||||
builder.setCustomSSLContext(sc);
|
builder.setCustomSSLContext(sc);
|
||||||
}
|
}
|
||||||
builder.setSecurityMode(configuration.securityMode);
|
builder.setSecurityMode(configuration.securityMode);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2015 Florian Schmaus
|
* Copyright 2015-2016 Florian Schmaus
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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.SubTypesScanner;
|
||||||
import org.reflections.scanners.TypeAnnotationsScanner;
|
import org.reflections.scanners.TypeAnnotationsScanner;
|
||||||
|
|
||||||
import eu.geekplace.javapinning.JavaPinning;
|
import eu.geekplace.javapinning.java7.Java7Pinning;
|
||||||
|
|
||||||
public class SmackIntegrationTestFramework {
|
public class SmackIntegrationTestFramework {
|
||||||
|
|
||||||
|
@ -529,7 +529,7 @@ public class SmackIntegrationTestFramework {
|
||||||
.setSecurityMode(config.securityMode);
|
.setSecurityMode(config.securityMode);
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
if (StringUtils.isNotEmpty(config.serviceTlsPin)) {
|
if (StringUtils.isNotEmpty(config.serviceTlsPin)) {
|
||||||
SSLContext sc = JavaPinning.forPin(config.serviceTlsPin);
|
SSLContext sc = Java7Pinning.forPin(config.serviceTlsPin);
|
||||||
builder.setCustomSSLContext(sc);
|
builder.setCustomSSLContext(sc);
|
||||||
}
|
}
|
||||||
XMPPTCPConnection connection = new XMPPTCPConnection(builder.build());
|
XMPPTCPConnection connection = new XMPPTCPConnection(builder.build());
|
||||||
|
@ -554,7 +554,7 @@ public class SmackIntegrationTestFramework {
|
||||||
SmackException, IOException, XMPPException {
|
SmackException, IOException, XMPPException {
|
||||||
XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();
|
XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();
|
||||||
if (config.serviceTlsPin != null) {
|
if (config.serviceTlsPin != null) {
|
||||||
SSLContext sc = JavaPinning.forPin(config.serviceTlsPin);
|
SSLContext sc = Java7Pinning.forPin(config.serviceTlsPin);
|
||||||
builder.setCustomSSLContext(sc);
|
builder.setCustomSSLContext(sc);
|
||||||
}
|
}
|
||||||
builder.setSecurityMode(config.securityMode);
|
builder.setSecurityMode(config.securityMode);
|
||||||
|
|
Loading…
Reference in a new issue