【发布时间】:2022-12-27 15:39:01
【问题描述】:
I have a Springboot GRPC client which using a cert file to connect to another grpc server.
file = inputStreamToFile(MyTest.class.getResourceAsStream("cert.pem"));
SslContext sslContext = GrpcSslContexts.forClient().trustManager(file).build();
ManagedChannel channel = NettyChannelBuilder.forAddress(host, port).sslContext(sslContext).build();
The implementation works fine as expected in local springboot run via Intellij; tested the interaction with server, works as expected but when i run the application by "mvn clean install", I got error, how to fix this?
Caused by: java.lang.IllegalArgumentException: File does not contain valid certificates: cert.pem
Caused by: java.security.cert.CertificateException: found no certificates in input stream
【问题讨论】:
标签: java spring-boot ssl grpc