Skip to content

Commit 7fcd98d

Browse files
committed
temp testing changes
1 parent 7941abc commit 7fcd98d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/example-tls/src/main/java/io/grpc/examples/helloworldtls/HelloWorldClientTls.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
package io.grpc.examples.helloworldtls;
1818

19+
import static io.grpc.examples.helloworld.GreeterGrpc.getSayHelloMethod;
20+
21+
import io.grpc.CallOptions;
1922
import io.grpc.Channel;
2023
import io.grpc.Grpc;
2124
import io.grpc.ManagedChannel;
@@ -25,6 +28,7 @@
2528
import io.grpc.examples.helloworld.HelloReply;
2629
import io.grpc.examples.helloworld.HelloRequest;
2730
import java.io.File;
31+
import java.io.IOException;
2832
import java.util.concurrent.TimeUnit;
2933
import java.util.logging.Level;
3034
import java.util.logging.Logger;
@@ -52,7 +56,11 @@ public void greet(String name) {
5256
HelloRequest request = HelloRequest.newBuilder().setName(name).build();
5357
HelloReply response;
5458
try {
55-
response = blockingStub.sayHello(request);
59+
CallOptions callOptions = blockingStub.getCallOptions()
60+
.withAuthority("moo.test.goog.fr");
61+
response = io.grpc.stub.ClientCalls.blockingUnaryCall(
62+
blockingStub.getChannel(), getSayHelloMethod(),
63+
callOptions, request);
5664
} catch (StatusRuntimeException e) {
5765
logger.log(Level.WARNING, "RPC failed: {0}", e.getStatus());
5866
return;

0 commit comments

Comments
 (0)