1
votes

I am fairly new to GRPC and Java GRPC is my intent to work on. I have a GRPC server running successfully behind an envoy Load Balancer secured using X.509 based certs/keys. Now, I am facing problem while creating a client for same.

Maven repository suggests that latest io.grpc version available is 1.17.1 and the examples mentioned on the Github for GRPC is 1.19.0-SNAPSHOT or 1.17.3-SNAPSHOT.

I did copied the whole repo and build/install the code on my local dev environment where I am facing an issue while running the client (TLS) example as well as my own code.

My pom is

<properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <grpc.version>1.19.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
                <protoc.version>3.5.1-1</protoc.version>
                <netty.tcnative.version>2.0.20.Final</netty.tcnative.version>
                <!-- required for jdk9 -->
                <maven.compiler.source>1.8</maven.compiler.source>
                <maven.compiler.target>1.8</maven.compiler.target>
        </properties>

and the error I am getting is related to the protoc-gen-grpc-java,

io.grpc:protoc-gen-grpc-java:exe:linux-x86_64:1.19.0-SNAPSHOT

I have build and installed the GRPC-JAVA as per their git page with skipcodegen=true property and it is supposed to locally install the required jars in local maven repo. Looks like other are there like protobuf, etc but not this one.

Then I tried with 1.17.1 which is latest available on Maven and my pom is

<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <grpc.version>1.17.1</grpc.version><!-- CURRENT_GRPC_VERSION -->
        <protobuf.version>3.5.1</protobuf.version>
        <protoc.version>3.5.1-1</protoc.version>
        <netty.tcnative.version>2.0.7.Final</netty.tcnative.version>
        <!-- required for jdk9 -->
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

Here the error is -

An exception occured while executing the Java class. Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt, or Jetty NPN/ALPN available

I am not exactly sure what can be the issue and any help would be really appreciable.

J

1

1 Answers

0
votes

You should generally not use SNAPSHOT versions. The examples do not use SNAPSHOT versions for release tags. Check out the most recent release tag when trying out the examples. That should resolve any problem with protoc-gen-grpc-java missing (caused by skipCodegen=true).

There should be INFO level logs just before the "Could not find TLS ALPN provider" exception threw. There are three important log entries: "netty-tcnative unavailable (this may be normal)", "Conscrypt not found (this may be normal)", and "Jetty ALPN unavailable (this may be normal)". They will have exceptions will additional information that should make the problem more clear.

If you still have trouble, try running the Google Cloud Compat Checker. It checks for common problems that would prevent ALTS from functioning.

You can also reference gRPC's SECURITY.md for troubleshooting information.