【问题标题】:IllegalArgumentException: File does not contain valid certificates:IllegalArgumentException: File does not contain valid certificates:
【发布时间】: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


    【解决方案1】:

    have you found some solution ?

    【讨论】:

      猜你喜欢
      • 2022-12-02
      • 2021-10-28
      • 2013-09-21
      • 1970-01-01
      • 1970-01-01
      • 2017-01-09
      • 1970-01-01
      • 2021-09-19
      • 2019-09-15
      相关资源
      最近更新 更多