From 8424288de2ec3784b2e1005109d19d18ed0a5489 Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 24 May 2021 22:52:56 -0400 Subject: [PATCH] problem: unit tests failed because of enabled jdk ssl implementation --- .github/workflows/test.yaml | 3 +++ build.gradle | 6 ++++-- .../groovy/io/emeraldpay/dshackle/TlsSetupSpec.groovy | 11 +++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ce4827ba..8ba13463 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -25,6 +25,9 @@ jobs: with: java-version: 13 + - name: Install System Libs + run: sudo apt-get install -y openssl libapr1 + - name: Check uses: eskatos/gradle-command-action@v1 with: diff --git a/build.gradle b/build.gradle index 22d45883..09a746ad 100644 --- a/build.gradle +++ b/build.gradle @@ -71,12 +71,14 @@ dependencies { implementation "io.netty:netty-common:$nettyVersion" implementation "io.netty:netty-handler:$nettyVersion" implementation "io.netty:netty-handler-proxy:$nettyVersion" + implementation "io.netty:netty-resolver:$nettyVersion" + implementation "io.netty:netty-resolver-dns:$nettyVersion" implementation "io.netty:netty-codec:$nettyVersion" implementation "io.netty:netty-codec-http2:$nettyVersion" implementation "io.netty:netty-codec-http:$nettyVersion" implementation "io.netty:netty-buffer:$nettyVersion" - implementation "io.netty:netty-tcnative:2.0.39.Final:linux-x86_64@jar" - implementation "io.netty:netty-tcnative-boringssl-static:2.0.39.Final:linux-x86_64@jar" + implementation "io.netty:netty-tcnative:2.0.39.Final" + implementation "io.netty:netty-tcnative-boringssl-static:2.0.39.Final" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" implementation "org.jetbrains.kotlin:kotlin-reflect" diff --git a/src/test/groovy/io/emeraldpay/dshackle/TlsSetupSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/TlsSetupSpec.groovy index 75cd5e42..4f20bf44 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/TlsSetupSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/TlsSetupSpec.groovy @@ -18,6 +18,7 @@ package io.emeraldpay.dshackle import io.emeraldpay.dshackle.config.AuthConfig import io.netty.handler.ssl.ClientAuth +import io.netty.handler.ssl.OpenSsl import io.netty.handler.ssl.OpenSslServerContext import io.netty.handler.ssl.SslContext import spock.lang.Specification @@ -27,6 +28,13 @@ class TlsSetupSpec extends Specification { TlsSetup tlsSetup = new TlsSetup(new FileResolver(new File("src/test/resources/tls-local"))) + def setup() { + // !!!!!!!!!!!! + // run test on OS with OpenSSL installed + // !!!!!!!!!!!! + OpenSsl.ensureAvailability() + } + def "TLS disabled"() { setup: def config = new AuthConfig.ServerTlsAuth( @@ -52,7 +60,7 @@ class TlsSetupSpec extends Specification { act.server !act.client with((OpenSslServerContext) act) { - act.clientAuth == ClientAuth.NONE + clientAuth == ClientAuth.NONE with((X509CertImpl) keyCertChain[0]) { getIssuerDN().name == "CN=ca.myhost.dev, OU=Blockchain CA, O=My Company" } @@ -75,7 +83,6 @@ class TlsSetupSpec extends Specification { act.server !act.client - // run test on OS with OpenSSL installed with((OpenSslServerContext) act) { clientAuth == ClientAuth.REQUIRE with((X509CertImpl) keyCertChain[0]) {