Skip to content

Commit 4c44e4c

Browse files
committed
Add comment and rename some confusing method names.
1 parent 5a54372 commit 4c44e4c

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
@@ -155,12 +155,12 @@ private void updateSslContextWhenReady() {
155155
updateSslContext();
156156
clearKeysAndCerts();
157157
}
158-
} else if (isClientSideTls()) {
158+
} else if (isNormalTlsAndClientSide()) {
159159
if (savedTrustedRoots != null || savedSpiffeTrustMap != null) {
160160
updateSslContext();
161161
clearKeysAndCerts();
162162
}
163-
} else if (isServerSideTls()) {
163+
} else if (isNormalTlsAndServerSide()) {
164164
if (savedKey != null) {
165165
updateSslContext();
166166
clearKeysAndCerts();
@@ -179,11 +179,13 @@ protected final boolean isMtls() {
179179
return certInstance != null && (rootCertInstance != null || isUsingSystemRootCerts);
180180
}
181181

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

186-
protected final boolean isServerSideTls() {
188+
protected final boolean isNormalTlsAndServerSide() {
187189
return certInstance != null && rootCertInstance == null;
188190
}
189191

0 commit comments

Comments
 (0)