Hi All,
I'm trying to use GRPC in a client and server written in Scala 2.10 using
grpc-java 1.10.0 and scala-pb 0.7.1. My client code looks like this:
import io.grpc.netty.shaded.io.grpc.netty.{GrpcSslContexts, NegotiationType,
NettyChannelBuilder, NettyServerBuilder}
import io.grpc.netty.shaded.io.netty.handler.ssl.{ClientAuth, JdkSslContext,
SslContextBuilder}
val sslChannel = //Internal library to create ssl context
val jdkSslClientContext = new JdkSslContext(sslContext, true,
ClientAuth.REQUIRE)
val sslChannel = NettyChannelBuilder
.forAddress(host, sslPort)
.negotiationType(NegotiationType.TLS)
.sslContext(jdkSslClientContext)
.build()
However, when running this code (on a mac), I get the following exception:
java.lang.IllegalArgumentException: ALPN must be enabled and list HTTP/2 as
a supported protocol.
at
com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at
io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.ensureAlpnAndH2Enabled(GrpcSslContexts.java:184)
at
io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder.sslContext(NettyChannelBuilder.java:187)
I've done some digging online and come across this
page: https://github.com/grpc/grpc-java/blob/master/SECURITY.md. I've done
the recommended approach of using netty-tcnative-boringssl by adding it
into my build.sbt as follows (for multiple versions as well):
"io.netty" % "netty-tcnative-boringssl-static" % "2.0.8.Final"
Unfortunately this doesn't seem to help. Is there a specific version I
should be using? Or is there a way to see if I'm having linking errors
using openssl? Do I need any specific JVM flags to use this correctly?
Thanks for the help!
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/e5e7b2c2-08ee-446c-ac8b-51157ecff8aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.