Skip to content

Exception in thread "main" java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured #3668

@tripathysa

Description

@tripathysa

I am trying to use grpc java to connect to a service.

Java Version: 1.8
Gradle dependencies:

dependencies {

    //GRPC
    compile 'io.grpc:grpc-netty:1.1.2'
    compile 'io.grpc:grpc-protobuf:1.1.2'
    compile 'io.grpc:grpc-stub:1.1.2'
    compile 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork26'

Full Error log:

Exception in thread "main" java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.
	at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:159)
	at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:136)
	at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:124)
	at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:94)
	at com.ibm.watson.sentimentanalysis.fe.service.pipeline.customization.TestGrpcTrain.getSslContext(TestGrpcTrain.java:158)
	at com.ibm.watson.sentimentanalysis.fe.service.pipeline.customization.TestGrpcTrain.main(TestGrpcTrain.java:143)

at this line in my java grpc client code:

public static SslContext getSslContext(File certFile) throws SSLException {
        return GrpcSslContexts.forClient()
                .trustManager(certFile)
                .build();
    }

Here's my gradle dependency tree:
https://gist.github.com/tripathysa/7966ddb1e3c6751c19e7b9777a5a0419

Tried the troubleshooting guide: Used the same combination of

grpc-netty version | netty-handler version | netty-tcnative-boringssl-static version as mentioned here:
https://github.com/grpc/grpc-java/blob/master/SECURITY.md#troubleshooting

But still getting the error. Any help would be appreciated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions