Skip to content

Commit

Permalink
Get rid of deprecated SslContext methods in handler-proxy tests
Browse files Browse the repository at this point in the history
Motivation:

ProxyHandlerTest package uses deprecated methods SslContext.newServerContext and
SslContext.newClientContext.

Modifications:

SslContextBuilder is used to build server and client SslContext.

Result:

Less deprecated method in the code.
  • Loading branch information
kachayev authored and normanmaurer committed Jun 25, 2018
1 parent 028d9dc commit 00afb19
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.LineBasedFrameDecoder;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
import io.netty.handler.ssl.util.SelfSignedCertificate;
import io.netty.resolver.NoopAddressResolverGroup;
Expand Down Expand Up @@ -91,8 +92,8 @@ public class ProxyHandlerTest {
SslContext cctx;
try {
SelfSignedCertificate ssc = new SelfSignedCertificate();
sctx = SslContext.newServerContext(ssc.certificate(), ssc.privateKey());
cctx = SslContext.newClientContext(InsecureTrustManagerFactory.INSTANCE);
sctx = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey()).build();
cctx = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build();
} catch (Exception e) {
throw new Error(e);
}
Expand Down

0 comments on commit 00afb19

Please sign in to comment.