From afe3a3a14183a9efac573cfad86814d5bfab260d Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 8 Jun 2015 10:58:42 +0200 Subject: [PATCH] Not skip first cert when using OpenSslClientContext Motivation: Due a copy and paste error we incorrectly skipped the first cert in the keyCertChainFile when using OpenSslClientContext. Modifications: Correctly not skip the first cert. Result: The certificate chain is correctly setup when using OpenSslClientContext. --- .../main/java/io/netty/handler/ssl/OpenSslClientContext.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handler/src/main/java/io/netty/handler/ssl/OpenSslClientContext.java b/handler/src/main/java/io/netty/handler/ssl/OpenSslClientContext.java index ddaa62fa23..6d50884a78 100644 --- a/handler/src/main/java/io/netty/handler/ssl/OpenSslClientContext.java +++ b/handler/src/main/java/io/netty/handler/ssl/OpenSslClientContext.java @@ -184,8 +184,8 @@ public final class OpenSslClientContext extends OpenSslContext { } synchronized (OpenSslContext.class) { if (trustCertChainFile != null) { - /* Load the certificate chain. We must skip the first cert when server mode */ - if (!SSLContext.setCertificateChainFile(ctx, trustCertChainFile.getPath(), true)) { + /* Load the certificate chain. We must NOT skip the first cert when client mode */ + if (!SSLContext.setCertificateChainFile(ctx, trustCertChainFile.getPath(), false)) { long error = SSL.getLastErrorNumber(); if (OpenSsl.isError(error)) { throw new SSLException(