Skip to content

Commit

Permalink
move S2A check to end of determineEndpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmehta19 committed Jan 23, 2025
1 parent b046dc9 commit 6f56cff
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,6 @@ private String determineUniverseDomain() {

/** Determines the fully resolved endpoint and universe domain values */
private String determineEndpoint() throws IOException {
// Check if Experimental S2A feature enabled. When feature is non-experimental, remove this
// check from this function, and plumb MTLS endpoint to channel creation logic separately.
if (shouldUseS2A()) {
return mtlsEndpoint();
}
MtlsProvider mtlsProvider = mtlsProvider() == null ? new MtlsProvider() : mtlsProvider();
// TransportChannelProvider's endpoint will override the ClientSettings' endpoint
String customEndpoint =
Expand Down Expand Up @@ -307,6 +302,12 @@ private String determineEndpoint() throws IOException {
throw new IllegalArgumentException(
"mTLS is not supported in any universe other than googleapis.com");
}

// Check if Experimental S2A feature enabled. When feature is non-experimental, remove this
// check from this function, and plumb MTLS endpoint to channel creation logic separately.
if (shouldUseS2A()) {
return mtlsEndpoint();
}
return endpoint;
}

Expand Down

0 comments on commit 6f56cff

Please sign in to comment.