Skip to content

Commit ae74a9e

Browse files
committed
Merge branch 'clientsidenormaltls-systemrootcert-handle' into systemrootcerts-ignore-trusted-root-updates
2 parents 90abe55 + 4c44e4c commit ae74a9e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

xds/src/main/java/io/grpc/xds/internal/security/certprovider/CertProviderSslContextProvider.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ private void updateSslContextWhenReady() {
158158
updateSslContext();
159159
clearKeysAndCerts();
160160
}
161-
} else if (isClientSideTls()) {
161+
} else if (isNormalTlsAndClientSide()) {
162162
if (savedTrustedRoots != null || savedSpiffeTrustMap != null) {
163163
updateSslContext();
164164
clearKeysAndCerts();
165165
}
166-
} else if (isServerSideTls()) {
166+
} else if (isNormalTlsAndServerSide()) {
167167
if (savedKey != null) {
168168
updateSslContext();
169169
clearKeysAndCerts();
@@ -182,11 +182,13 @@ protected final boolean isMtls() {
182182
return certInstance != null && (rootCertInstance != null || isUsingSystemRootCerts);
183183
}
184184

185-
protected final boolean isClientSideTls() {
185+
protected final boolean isNormalTlsAndClientSide() {
186+
// We don't do (rootCertInstance != null || isUsingSystemRootCerts) here because of where this method is called
187+
// from. With the rootCertInstance being null when using system root certs, there is nothing to update.
186188
return rootCertInstance != null && certInstance == null;
187189
}
188190

189-
protected final boolean isServerSideTls() {
191+
protected final boolean isNormalTlsAndServerSide() {
190192
return certInstance != null && rootCertInstance == null;
191193
}
192194

0 commit comments

Comments
 (0)