我在连接到 NodeJS 服务器的 GRPC 客户端上使用 GRPC 版本:1.1.2 和 JDK 版本:1.8。Java 客户端能够正常连接,但是当我与客户端断开连接时,我总是在服务器端看到以下异常。
异常(仅在服务器上)
E0410 15:03:19.674531000 140735121084416 ssl_transport_security.c:439] SSL_read returned 0 unexpectedly.
E0410 15:03:19.674829000 140735121084416 secure_endpoint.c:185] Decryption error: TSI_INTERNAL_ERROR
我正在通过以下调用关闭 GRPC Java 连接:
channel.shutdown().awaitTermination(5, TimeUnit.SECONDS); //channel is ManagedChannel
在进行此调用之前,我应该清理任何其他资源,还是应该使用替代机制彻底断开与服务器的连接?
编辑 我注意到,当我尝试以下操作时,我得到了同样的错误:
channel.shutdown();
我在 Mac 上使用 OpenSSL - 我记得更改了默认 Mac 版本(OpenSSL 0.9.8zh 2016 年 1 月 14 日)。
grpc 中的secure_endpoint.c
result = tsi_frame_protector_unprotect(ep->protector, message_bytes,
&processed_message_size, cur,
&unprotected_buffer_size_written);
gpr_mu_unlock(&ep->protector_mu);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Decryption error: %s",
tsi_result_to_string(result));
break;
}