File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
xds/src/test/java/io/grpc/xds/internal/security Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,9 @@ private static CommonTlsContext.Builder addCertificateValidationContext(
229229 String rootInstanceName ,
230230 String rootCertName ,
231231 CertificateValidationContext staticCertValidationContext ) {
232+ if (staticCertValidationContext == null && rootInstanceName == null ) {
233+ return builder ;
234+ }
232235 CertificateValidationContext .Builder contextBuilder ;
233236 if (staticCertValidationContext == null ) {
234237 contextBuilder = CertificateValidationContext .newBuilder ();
Original file line number Diff line number Diff line change @@ -54,11 +54,11 @@ public class SslContextProviderSupplierTest {
5454
5555 private void prepareSupplier () {
5656 upstreamTlsContext =
57- CommonTlsContextTestsUtil .buildUpstreamTlsContext ("google_cloud_private_spiffe" , true );
57+ CommonTlsContextTestsUtil .buildUpstreamTlsContext ("google_cloud_private_spiffe" , true );
5858 mockSslContextProvider = mock (SslContextProvider .class );
5959 doReturn (mockSslContextProvider )
60- .when (mockTlsContextManager )
61- .findOrCreateClientSslContextProvider (eq (upstreamTlsContext ));
60+ .when (mockTlsContextManager )
61+ .findOrCreateClientSslContextProvider (eq (upstreamTlsContext ));
6262 supplier = new SslContextProviderSupplier (upstreamTlsContext , mockTlsContextManager );
6363 }
6464
@@ -135,4 +135,4 @@ public void testClose_nullSslContextProvider() {
135135 verify (mockTlsContextManager , times (1 ))
136136 .findOrCreateClientSslContextProvider (eq (upstreamTlsContext ));
137137 }
138- }
138+ }
You can’t perform that action at this time.
0 commit comments