GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Backport 4.1 Fix propagation of startTls for client SslContext handle… · lltopk/netty@d364fcc

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • handler/src/main/java/io/netty/handler/ssl
    • OpenSslClientContext.java
    • ReferenceCountedOpenSslClientContext.java
    • ReferenceCountedOpenSslContext.java
    • SslContext.java
    • SslContextBuilder.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎handler/src/main/java/io/netty/handler/ssl/OpenSslClientContext.java‎

Copy file name to clipboardExpand all lines: handler/src/main/java/io/netty/handler/ssl/OpenSslClientContext.java
+16-2Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public OpenSslClientContext(File trustCertCollectionFile, TrustManagerFactory tr
178178
this(toX509CertificatesInternal(trustCertCollectionFile), trustManagerFactory,
179179
toX509CertificatesInternal(keyCertChainFile), toPrivateKeyInternal(keyFile, keyPassword),
180180
keyPassword, keyManagerFactory, ciphers, cipherFilter, apn, null, sessionCacheSize,
181-
sessionTimeout, false, KeyStore.getDefaultType(), null, null);
181+
sessionTimeout, false, false, KeyStore.getDefaultType(), null, null);
182182
}
183183

184184
OpenSslClientContext(X509Certificate[] trustCertCollection, TrustManagerFactory trustManagerFactory,
@@ -189,7 +189,21 @@ public OpenSslClientContext(File trustCertCollectionFile, TrustManagerFactory tr
189189
String endpointIdentificationAlgorithm, ResumptionController resumptionController,
190190
Map.Entry<SslContextOption<?>, Object>... options)
191191
throws SSLException {
192-
super(ciphers, cipherFilter, apn, SSL.SSL_MODE_CLIENT, keyCertChain, ClientAuth.NONE, protocols, false,
192+
this(trustCertCollection, trustManagerFactory, keyCertChain, key, keyPassword, keyManagerFactory, ciphers,
193+
cipherFilter, apn, protocols, sessionCacheSize, sessionTimeout, false, enableOcsp, keyStore,
194+
endpointIdentificationAlgorithm, resumptionController, options);
195+
}
196+
197+
OpenSslClientContext(X509Certificate[] trustCertCollection, TrustManagerFactory trustManagerFactory,
198+
X509Certificate[] keyCertChain, PrivateKey key, String keyPassword,
199+
KeyManagerFactory keyManagerFactory, Iterable<String> ciphers,
200+
CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn, String[] protocols,
201+
long sessionCacheSize, long sessionTimeout, boolean startTls, boolean enableOcsp,
202+
String keyStore, String endpointIdentificationAlgorithm,
203+
ResumptionController resumptionController,
204+
Map.Entry<SslContextOption<?>, Object>... options)
205+
throws SSLException {
206+
super(ciphers, cipherFilter, apn, SSL.SSL_MODE_CLIENT, keyCertChain, ClientAuth.NONE, protocols, startTls,
193207
endpointIdentificationAlgorithm, enableOcsp, resumptionController, options);
194208
boolean success = false;
195209
try {
Collapse file

‎handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslClientContext.java‎

Copy file name to clipboardExpand all lines: handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslClientContext.java
+15-1Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,22 @@ public final class ReferenceCountedOpenSslClientContext extends ReferenceCounted
6666
boolean enableOcsp, String keyStore, String endpointIdentificationAlgorithm,
6767
ResumptionController resumptionController,
6868
Map.Entry<SslContextOption<?>, Object>... options) throws SSLException {
69+
this(trustCertCollection, trustManagerFactory, keyCertChain, key, keyPassword, keyManagerFactory, ciphers,
70+
cipherFilter, apn, protocols, sessionCacheSize, sessionTimeout, false, enableOcsp, keyStore,
71+
endpointIdentificationAlgorithm, resumptionController, options);
72+
}
73+
74+
ReferenceCountedOpenSslClientContext(X509Certificate[] trustCertCollection, TrustManagerFactory trustManagerFactory,
75+
X509Certificate[] keyCertChain, PrivateKey key, String keyPassword,
76+
KeyManagerFactory keyManagerFactory, Iterable<String> ciphers,
77+
CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn,
78+
String[] protocols, long sessionCacheSize, long sessionTimeout,
79+
boolean startTls, boolean enableOcsp, String keyStore,
80+
String endpointIdentificationAlgorithm,
81+
ResumptionController resumptionController,
82+
Map.Entry<SslContextOption<?>, Object>... options) throws SSLException {
6983
super(ciphers, cipherFilter, toNegotiator(apn), SSL.SSL_MODE_CLIENT, keyCertChain,
70-
ClientAuth.NONE, protocols, false, endpointIdentificationAlgorithm, enableOcsp, true,
84+
ClientAuth.NONE, protocols, startTls, endpointIdentificationAlgorithm, enableOcsp, true,
7185
resumptionController, options);
7286
boolean success = false;
7387
try {
Collapse file

‎handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java‎

Copy file name to clipboardExpand all lines: handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public abstract class ReferenceCountedOpenSslContext extends SslContext implemen
114114
static final boolean SERVER_ENABLE_SESSION_TICKET =
115115
SystemPropertyUtil.getBoolean("jdk.tls.server.enableSessionTicketExtension", false);
116116

117-
static final boolean SERVER_ENABLE_SESSION_TICKET_TLSV13 =
117+
static final boolean SERVER_ENABLE_SESSION_TICKET_TLSV13 =
118118
SystemPropertyUtil.getBoolean("jdk.tls.server.enableSessionTicketExtension", true);
119119

120120
static final boolean SERVER_ENABLE_SESSION_CACHE =
@@ -527,7 +527,7 @@ protected SslHandler newHandler(ByteBufAllocator alloc, boolean startTls, Execut
527527
@Override
528528
protected SslHandler newHandler(ByteBufAllocator alloc, String peerHost, int peerPort,
529529
boolean startTls, Executor executor) {
530-
return new SslHandler(newEngine0(alloc, peerHost, peerPort, false), false, executor, resumptionController);
530+
return new SslHandler(newEngine0(alloc, peerHost, peerPort, false), startTls, executor, resumptionController);
531531
}
532532

533533
SSLEngine newEngine0(ByteBufAllocator alloc, String peerHost, int peerPort, boolean jdkCompatibilityMode) {
Collapse file

‎handler/src/main/java/io/netty/handler/ssl/SslContext.java‎

Copy file name to clipboardExpand all lines: handler/src/main/java/io/netty/handler/ssl/SslContext.java
+19-2Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,21 @@ static SslContext newClientContextInternal(
826826
long sessionCacheSize, long sessionTimeout, boolean enableOcsp,
827827
SecureRandom secureRandom, String keyStoreType, String endpointIdentificationAlgorithm,
828828
Map.Entry<SslContextOption<?>, Object>... options) throws SSLException {
829+
return newClientContextInternal(provider, sslContextProvider, trustCert, trustManagerFactory, keyCertChain, key,
830+
keyPassword, keyManagerFactory, ciphers, cipherFilter, apn, protocols, sessionCacheSize,
831+
sessionTimeout, false, enableOcsp, secureRandom, keyStoreType, endpointIdentificationAlgorithm,
832+
options);
833+
}
834+
835+
static SslContext newClientContextInternal(
836+
SslProvider provider,
837+
Provider sslContextProvider,
838+
X509Certificate[] trustCert, TrustManagerFactory trustManagerFactory,
839+
X509Certificate[] keyCertChain, PrivateKey key, String keyPassword, KeyManagerFactory keyManagerFactory,
840+
Iterable<String> ciphers, CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn, String[] protocols,
841+
long sessionCacheSize, long sessionTimeout, boolean startTls, boolean enableOcsp,
842+
SecureRandom secureRandom, String keyStoreType, String endpointIdentificationAlgorithm,
843+
Map.Entry<SslContextOption<?>, Object>... options) throws SSLException {
829844
if (provider == null) {
830845
provider = defaultClientProvider();
831846
}
@@ -848,14 +863,16 @@ static SslContext newClientContextInternal(
848863
return new OpenSslClientContext(
849864
trustCert, trustManagerFactory, keyCertChain, key, keyPassword,
850865
keyManagerFactory, ciphers, cipherFilter, apn, protocols, sessionCacheSize, sessionTimeout,
851-
enableOcsp, keyStoreType, endpointIdentificationAlgorithm, resumptionController, options);
866+
startTls, enableOcsp, keyStoreType, endpointIdentificationAlgorithm,
867+
resumptionController, options);
852868
case OPENSSL_REFCNT:
853869
verifyNullSslContextProvider(provider, sslContextProvider);
854870
OpenSsl.ensureAvailability();
855871
return new ReferenceCountedOpenSslClientContext(
856872
trustCert, trustManagerFactory, keyCertChain, key, keyPassword,
857873
keyManagerFactory, ciphers, cipherFilter, apn, protocols, sessionCacheSize, sessionTimeout,
858-
enableOcsp, keyStoreType, endpointIdentificationAlgorithm, resumptionController, options);
874+
startTls, enableOcsp, keyStoreType, endpointIdentificationAlgorithm,
875+
resumptionController, options);
859876
default:
860877
throw new Error(provider.toString());
861878
}
Collapse file

‎handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java‎

Copy file name to clipboardExpand all lines: handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ public SslContext build() throws SSLException {
648648
return SslContext.newClientContextInternal(provider, sslContextProvider, trustCertCollection,
649649
trustManagerFactory, keyCertChain, key, keyPassword, keyManagerFactory,
650650
ciphers, cipherFilter, apn, protocols, sessionCacheSize,
651-
sessionTimeout, enableOcsp, secureRandom, keyStoreType, endpointIdentificationAlgorithm,
651+
sessionTimeout, startTls, enableOcsp, secureRandom, keyStoreType, endpointIdentificationAlgorithm,
652652
toArray(options.entrySet(), EMPTY_ENTRIES));
653653
}
654654
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.