Skip to content

Commit

Permalink
Upgrade Netty to 4.1.58 (#2678)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Langer <tomas.langer@oracle.com>
  • Loading branch information
tomas-langer authored Jan 24, 2021
1 parent ad450a9 commit 547190b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<version.lib.mssql-jdbc>8.4.1.jre8</version.lib.mssql-jdbc>
<version.lib.mysql-connector-java>8.0.22</version.lib.mysql-connector-java>
<version.lib.narayana>5.9.3.Final</version.lib.narayana>
<version.lib.netty>4.1.51.Final</version.lib.netty>
<version.lib.netty>4.1.58.Final</version.lib.netty>
<version.lib.oci-java-sdk-objectstorage>1.28.0</version.lib.oci-java-sdk-objectstorage>
<version.lib.ojdbc8>19.8.0.0</version.lib.ojdbc8>
<version.lib.database.messaging>19.3.0.0</version.lib.database.messaging>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2020 Oracle and/or its affiliates.
* Copyright (c) 2019, 2021 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,12 +35,14 @@
import io.grpc.EquivalentAddressGroup;
import io.grpc.NameResolver;
import io.grpc.StatusRuntimeException;
import io.netty.handler.codec.DecoderException;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import services.TreeMapService;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

Expand Down Expand Up @@ -185,13 +187,15 @@ public void shouldNotConnectWithoutCaCertTo2WaySslServer() {
@Test
public void shouldNotConnectWithoutClientCertTo2WaySslServer() {
StatusRuntimeException sre = assertThrows(StatusRuntimeException.class, () -> invokeUnary(port2WaySSL, WITH_CA_CERT + WITH_CLIENT_KEY));
assertThat(sre.getCause().getClass(), equalTo(javax.net.ssl.SSLHandshakeException.class));
assertThat(sre.getCause(), instanceOf(DecoderException.class));
assertThat(sre.getCause().getCause(), instanceOf(SSLException.class));
}

@Test
public void shouldNotConnectWithoutClientKeyTo2WaySslServer() {
StatusRuntimeException sre = assertThrows(StatusRuntimeException.class, () -> invokeUnary(port2WaySSL, WITH_CA_CERT + WITH_CLIENT_CERT));
assertThat(sre.getCause().getClass(), equalTo(javax.net.ssl.SSLHandshakeException.class));
assertThat(sre.getCause(), instanceOf(DecoderException.class));
assertThat(sre.getCause().getCause(), instanceOf(SSLException.class));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Oracle and/or its affiliates.
* Copyright (c) 2020, 2021 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,6 +32,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.endsWith;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
Expand Down Expand Up @@ -80,7 +81,7 @@ public void testNoClientCert() {
CompletionException exception = assertThrows(CompletionException.class,
() -> callSecured(webClient,
webServer.port("secured")));
assertThat(exception.getCause().getMessage(), is("Received fatal alert: bad_certificate"));
assertThat(exception.getCause().getMessage(), containsString("Received fatal alert: bad_certificate"));
}

@Test
Expand Down

0 comments on commit 547190b

Please sign in to comment.