@@ -123,7 +123,6 @@ public final class InstantiatingGrpcChannelProvider implements TransportChannelP
123
123
private final HeaderProvider headerProvider ;
124
124
private final boolean useS2A ;
125
125
private final String endpoint ;
126
- private final String mtlsEndpoint ;
127
126
// TODO: remove. envProvider currently provides DirectPath environment variable, and is only used
128
127
// during initial rollout for DirectPath. This provider will be removed once the DirectPath
129
128
// environment is not used.
@@ -154,7 +153,6 @@ private InstantiatingGrpcChannelProvider(Builder builder) {
154
153
this .headerProvider = builder .headerProvider ;
155
154
this .useS2A = builder .useS2A ;
156
155
this .endpoint = builder .endpoint ;
157
- this .mtlsEndpoint = builder .mtlsEndpoint ;
158
156
this .mtlsProvider = builder .mtlsProvider ;
159
157
this .s2aConfigProvider = builder .s2aConfigProvider ;
160
158
this .envProvider = builder .envProvider ;
@@ -231,11 +229,6 @@ public boolean needsEndpoint() {
231
229
return endpoint == null ;
232
230
}
233
231
234
- @ Override
235
- public boolean needsMtlsEndpoint () {
236
- return mtlsEndpoint == null ;
237
- }
238
-
239
232
/**
240
233
* Specify the endpoint the channel should connect to.
241
234
*
@@ -250,21 +243,6 @@ public TransportChannelProvider withEndpoint(String endpoint) {
250
243
return toBuilder ().setEndpoint (endpoint ).build ();
251
244
}
252
245
253
- /**
254
- * Specify the mtlsEndpoint the channel should connect to.
255
- *
256
- * <p>The value of {@code mtlsEndpoint} must be of the form {@code host:port}.
257
- *
258
- * @param mtlsEndpoint The mtlsEndpoint to connect to
259
- * @return A new {@link InstantiatingGrpcChannelProvider} with the specified mtlsEndpoint
260
- * configured
261
- */
262
- @ Override
263
- public TransportChannelProvider withMtlsEndpoint (String mtlsEndpoint ) {
264
- validateEndpoint (mtlsEndpoint );
265
- return toBuilder ().setMtlsEndpoint (mtlsEndpoint ).build ();
266
- }
267
-
268
246
/**
269
247
* Specify whether or not to use S2A.
270
248
*
@@ -549,8 +527,7 @@ ChannelCredentials createPlaintextToS2AChannelCredentials(String plaintextAddres
549
527
* returns null; in this case S2A will not be used, and a TLS connection to the service will be
550
528
* established.
551
529
*
552
- * @return {@link ChannelCredentials} configured to use S2A to create mTLS connection to
553
- * mtlsEndpoint.
530
+ * @return {@link ChannelCredentials} configured to use S2A to create mTLS connection.
554
531
*/
555
532
ChannelCredentials createS2ASecuredChannelCredentials () {
556
533
SecureSessionAgentConfig config = s2aConfigProvider .getConfig ();
@@ -648,7 +625,7 @@ private ManagedChannel createSingleChannel() throws IOException {
648
625
}
649
626
if (channelCredentials != null ) {
650
627
// Create the channel using S2A-secured channel credentials.
651
- builder = Grpc .newChannelBuilder (mtlsEndpoint , channelCredentials );
628
+ builder = Grpc .newChannelBuilder (endpoint , channelCredentials );
652
629
} else {
653
630
// Use default if we cannot initialize channel credentials via DCA or S2A.
654
631
builder = ManagedChannelBuilder .forAddress (serviceAddress , port );
@@ -800,7 +777,6 @@ public static final class Builder {
800
777
private Executor executor ;
801
778
private HeaderProvider headerProvider ;
802
779
private String endpoint ;
803
- private String mtlsEndpoint ;
804
780
private boolean useS2A ;
805
781
private EnvironmentProvider envProvider ;
806
782
private SecureSessionAgent s2aConfigProvider = SecureSessionAgent .create ();
@@ -831,7 +807,6 @@ private Builder(InstantiatingGrpcChannelProvider provider) {
831
807
this .executor = provider .executor ;
832
808
this .headerProvider = provider .headerProvider ;
833
809
this .endpoint = provider .endpoint ;
834
- this .mtlsEndpoint = provider .mtlsEndpoint ;
835
810
this .useS2A = provider .useS2A ;
836
811
this .envProvider = provider .envProvider ;
837
812
this .interceptorProvider = provider .interceptorProvider ;
@@ -902,22 +877,11 @@ public Builder setEndpoint(String endpoint) {
902
877
return this ;
903
878
}
904
879
905
- /** Sets the mtlsEndpoint used to reach the service, eg "localhost:8080". */
906
- public Builder setMtlsEndpoint (String mtlsEndpoint ) {
907
- validateEndpoint (mtlsEndpoint );
908
- this .mtlsEndpoint = mtlsEndpoint ;
909
- return this ;
910
- }
911
-
912
880
Builder setUseS2A (boolean useS2A ) {
913
881
this .useS2A = useS2A ;
914
882
return this ;
915
883
}
916
884
917
- public String getMtlsEndpoint () {
918
- return mtlsEndpoint ;
919
- }
920
-
921
885
@ VisibleForTesting
922
886
Builder setMtlsProvider (MtlsProvider mtlsProvider ) {
923
887
this .mtlsProvider = mtlsProvider ;
0 commit comments