ensured BC provider was last on TLS run (Java 11/Java 17 issues with XDH/EdDSA)
import java.security.Security;
import java.util.Vector;
+import junit.framework.Test;
+import junit.framework.TestSuite;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.tls.AlertDescription;
import org.bouncycastle.tls.HashAlgorithm;
import org.bouncycastle.tls.crypto.impl.bc.BcTlsCrypto;
import org.bouncycastle.tls.crypto.impl.jcajce.JcaTlsCryptoProvider;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
public class TlsTestSuite extends TestSuite
{
static TlsCrypto BC_CRYPTO = new BcTlsCrypto(new SecureRandom());
@@ -50,6 +49,14 @@ public static Test suite()
{
Security.addProvider(new BouncyCastleProvider());
}
+ else
+ {
+ // remove the old one.
+ Security.removeProvider("BC");
+
+ // make sure BC provider is at the end
+ Security.addProvider(new BouncyCastleProvider());
+ }
TlsTestSuite testSuite = new TlsTestSuite();
addAllTests(testSuite, TlsTestConfig.CRYPTO_BC, TlsTestConfig.CRYPTO_BC);
