【问题标题】:ssl handshake issue between GRPC Java client and NodeJS serverGRPC Java客户端和NodeJS服务器之间的ssl握手问题
【发布时间】:2017-03-13 20:14:17
【问题描述】:

我正在使用 GRPC(Java 客户端)通过 SSL 连接到 NodeJS 服务器。我正在使用的 SSL 上下文复制如下。我尝试运行 ssldump(在 Mac El Capitan OS 上)来帮助调试。当我尝试连接并向服务器发送消息时,服务器上出现以下异常:

chttp2_server.c:123] Handshaking failed: {"created":"@1489433622.628015000","description":"Handshake read failed","file":"../src/core/lib/security/transport/security_handshaker.c","file_line":238,"referenced_errors":[{"created":"@1489433622.628009000","description":"Socket closed","fd":24,"file":"../src/core/lib/iomgr/tcp_posix.c","file_line":249,"target_address":"ipv6:[::1]:60820"}]}


        SslContext sslContext = GrpcSslContexts.forClient()
                .startTls(true)
                .sslProvider(defaultSslProvider())
                .trustManager(publicCert)
                .keyManager(clientCert, clientKey)
               // .ciphers(null)  //testing
                .build();

我只看到 ssldump 的以下输出:

780    1880.8428 (0.0405)  C>S  TCP FIN
780    1880.8433 (0.0005)  S>C  TCP FIN
New TCP connection #1020: localhost(61531) <-> localhost(96758)
1.3625 (1.3625)  C>S
---------------------------------------------------------------
1e 0a 16 08 b9 c6 ed bc b9 9e 84 98 e3 01 10 95    ................
b8 b5 a5 8e 8c c3 bb 91 01 10 02 22 02 08 01       ..........."...
---------------------------------------------------------------

New TCP connection #1021: localhost(61532) <-> localhost(90051)

对于如何进一步解决此问题的任何想法将不胜感激。

【问题讨论】:

    标签: java ssl netty grpc-java


    【解决方案1】:

    我删除了似乎导致问题的“usePlaintext(false)”语句。

    channelBuilder = NettyChannelBuilder.forAddress(host, port)
                        .overrideAuthority("localhost")
                        .negotiationType(NegotiationType.TLS)
                        **//.usePlaintext(false)**
                        .sslContext(sslContext);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-08-08
      • 1970-01-01
      • 2016-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-07
      相关资源
      最近更新 更多