|
51 | 51 | import io.grpc.Status; |
52 | 52 | import io.grpc.StatusOr; |
53 | 53 | import io.grpc.StatusRuntimeException; |
54 | | -import io.grpc.TlsServerCredentials; |
55 | 54 | import io.grpc.stub.StreamObserver; |
56 | 55 | import io.grpc.testing.GrpcCleanupRule; |
57 | | -import io.grpc.testing.TlsTesting; |
58 | 56 | import io.grpc.testing.protobuf.SimpleRequest; |
59 | 57 | import io.grpc.testing.protobuf.SimpleResponse; |
60 | 58 | import io.grpc.testing.protobuf.SimpleServiceGrpc; |
@@ -515,36 +513,6 @@ public void mtlsClientServer_changeServerContext_expectException() |
515 | 513 | } |
516 | 514 | } |
517 | 515 |
|
518 | | - @Test |
519 | | - public void mtlsClientServer_withClientAuthentication_withTlsChannelCredsFromBootstrap() |
520 | | - throws Exception { |
521 | | - final String mtlsCertProviderInstanceName = "mtls_channel_creds_identity_certs"; |
522 | | - |
523 | | - UpstreamTlsContext upstreamTlsContext = |
524 | | - setBootstrapInfoWithMTlsChannelCredsAndBuildUpstreamTlsContext( |
525 | | - mtlsCertProviderInstanceName, CLIENT_KEY_FILE, CLIENT_PEM_FILE, CA_PEM_FILE); |
526 | | - |
527 | | - DownstreamTlsContext downstreamTlsContext = |
528 | | - setBootstrapInfoWithMTlsChannelCredsAndBuildDownstreamTlsContext( |
529 | | - mtlsCertProviderInstanceName, SERVER_1_KEY_FILE, SERVER_1_PEM_FILE, CA_PEM_FILE); |
530 | | - |
531 | | - ServerCredentials serverCreds = TlsServerCredentials.newBuilder() |
532 | | - .keyManager(TlsTesting.loadCert(SERVER_1_PEM_FILE), TlsTesting.loadCert(SERVER_1_KEY_FILE)) |
533 | | - .trustManager(TlsTesting.loadCert(CA_PEM_FILE)) |
534 | | - .clientAuth(TlsServerCredentials.ClientAuth.REQUIRE) |
535 | | - .build(); |
536 | | - |
537 | | - buildServer( |
538 | | - XdsServerBuilder.forPort(0, serverCreds) |
539 | | - .xdsClientPoolFactory(fakePoolFactory) |
540 | | - .addService(new SimpleServiceImpl()), |
541 | | - downstreamTlsContext); |
542 | | - |
543 | | - SimpleServiceGrpc.SimpleServiceBlockingStub blockingStub = |
544 | | - getBlockingStub(upstreamTlsContext, OVERRIDE_AUTHORITY); |
545 | | - assertThat(unaryRpc("buddy", blockingStub)).isEqualTo("Hello buddy"); |
546 | | - } |
547 | | - |
548 | 516 | private void performMtlsTestAndGetListenerWatcher( |
549 | 517 | UpstreamTlsContext upstreamTlsContext, String certInstanceName2, |
550 | 518 | String privateKey2, String cert2, String trustCa2) |
@@ -605,22 +573,6 @@ private UpstreamTlsContext setBootstrapInfoAndBuildUpstreamTlsContextForUsingSys |
605 | 573 | .build()); |
606 | 574 | } |
607 | 575 |
|
608 | | - private UpstreamTlsContext setBootstrapInfoWithMTlsChannelCredsAndBuildUpstreamTlsContext( |
609 | | - String instanceName, String clientKeyFile, String clientPemFile, String caCertFile) { |
610 | | - bootstrapInfoForClient = CommonBootstrapperTestUtils |
611 | | - .buildBootstrapInfoForMTlsChannelCredentialServerInfo( |
612 | | - instanceName, clientKeyFile, clientPemFile, caCertFile); |
613 | | - return CommonTlsContextTestsUtil.buildUpstreamTlsContext(instanceName, true); |
614 | | - } |
615 | | - |
616 | | - private DownstreamTlsContext setBootstrapInfoWithMTlsChannelCredsAndBuildDownstreamTlsContext( |
617 | | - String instanceName, String serverKeyFile, String serverPemFile, String caCertFile) { |
618 | | - bootstrapInfoForServer = CommonBootstrapperTestUtils |
619 | | - .buildBootstrapInfoForMTlsChannelCredentialServerInfo( |
620 | | - instanceName, serverKeyFile, serverPemFile, caCertFile); |
621 | | - return CommonTlsContextTestsUtil.buildDownstreamTlsContext(instanceName, true, true); |
622 | | - } |
623 | | - |
624 | 576 | private void buildServerWithTlsContext(DownstreamTlsContext downstreamTlsContext) |
625 | 577 | throws Exception { |
626 | 578 | buildServerWithTlsContext(downstreamTlsContext, InsecureServerCredentials.create()); |
|
0 commit comments