Skip to content

Instantly share code, notes, and snippets.

@gistlyn gistlyn/
Last active Dec 30, 2019

What would you like to do?
Java Google protoc SSL gRPC Service Client TodoWorld Example
import io.grpc.ManagedChannel;
import io.grpc.netty.GrpcSslContexts;
import io.grpc.netty.NettyChannelBuilder;
public class Program {
public static void main(String[] args) throws {
ManagedChannel channel = NettyChannelBuilder.forAddress(
"", 50051)
.trustManager(new File(Program.class.getClassLoader().getResource("grpc.crt").getFile()))
GrpcServicesGrpc.GrpcServicesBlockingStub client = GrpcServicesGrpc.newBlockingStub(channel);
Services.Hello request = Services.Hello.newBuilder().setName("gRPC Java").build();
String result = client.getHello(request).getResult();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.