MCPcopy Create free account
hub / github.com/grpc/grpc-java / basicTls_succeeds

Method basicTls_succeeds

okhttp/src/test/java/io/grpc/okhttp/TlsTest.java:93–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91 }
92
93 @Test
94 public void basicTls_succeeds() throws Exception {
95 ServerCredentials serverCreds;
96 try (InputStream serverCert = TlsTesting.loadCert("server1.pem");
97 InputStream serverPrivateKey = TlsTesting.loadCert("server1.key")) {
98 serverCreds = TlsServerCredentials.newBuilder()
99 .keyManager(serverCert, serverPrivateKey)
100 .build();
101 }
102 ChannelCredentials channelCreds;
103 try (InputStream caCert = TlsTesting.loadCert("ca.pem")) {
104 channelCreds = TlsChannelCredentials.newBuilder()
105 .trustManager(caCert)
106 .build();
107 }
108 Server server = grpcCleanupRule.register(server(serverCreds));
109 ManagedChannel channel = grpcCleanupRule.register(clientChannel(server, channelCreds));
110
111 SimpleServiceGrpc.newBlockingStub(channel).unaryRpc(SimpleRequest.getDefaultInstance());
112 }
113
114 @Test
115 public void perRpcAuthorityOverride_hostnameVerifier_goodAuthority_succeeds() throws Exception {

Callers

nothing calls this directly

Calls 12

loadCertMethod · 0.95
newBuilderMethod · 0.95
newBuilderMethod · 0.95
serverMethod · 0.95
clientChannelMethod · 0.95
newBlockingStubMethod · 0.95
buildMethod · 0.65
registerMethod · 0.65
unaryRpcMethod · 0.65
keyManagerMethod · 0.45
trustManagerMethod · 0.45
getDefaultInstanceMethod · 0.45

Tested by

no test coverage detected