Skip to content

Commit 8f8df7b

Browse files
authored
fix: Only send mtlsEndpoint if it is non-null (#3767)
Temporary fix to only plumb the mtlsEndpoint to the gRPCChannelProviders if this has been set with a non-null value. Validation will still go through if it is set with bogus values. Issue reported in googleapis/java-bigtable#2565 This seems to due to how Bigtable wrappers the generated stubs. BigTable manually calls setEndpoint to for the StubSettings, but does not do the equivalent for setMtlsEndpoint. The EndpointContext is only aware of the TLS endpoint and passes a null value to the ChannelProviders. Potential longer term fix: BigTable's wrappers would need to set the mTLS Endpoint. This would be needed for BigTable to support S2A. This does not impact any of BigTable's existing functionality as the endpoint resolution for all non-S2A flows is done via `setEndpoint()`.
1 parent 406a180 commit 8f8df7b

File tree

2 files changed

+132
-41
lines changed

2 files changed

+132
-41
lines changed

gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public static ClientContext create(StubSettings settings) throws IOException {
223223
transportChannelProvider = transportChannelProvider.withEndpoint(endpoint);
224224
}
225225
transportChannelProvider = transportChannelProvider.withUseS2A(endpointContext.useS2A());
226-
if (transportChannelProvider.needsMtlsEndpoint()) {
226+
if (transportChannelProvider.needsMtlsEndpoint() && endpointContext.mtlsEndpoint() != null) {
227227
transportChannelProvider =
228228
transportChannelProvider.withMtlsEndpoint(endpointContext.mtlsEndpoint());
229229
}

0 commit comments

Comments
 (0)