使用 GRPC 时 SSL 解密错误
SSL decryption error while using GRPC
我在连接到 NodeJS 服务器的 GRPC 客户端上使用 GRPC 版本:1.1.2 & JDK version: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 日)。
secure_endpoint.c 在 grpc
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;
}
ManagedChannel.shutdown()
向服务器指示不应再启动新的 RPC。所有现有的 RPC,尤其是流式 RPC 将继续 运行。一旦所有这些 RPC 完成,ManagedChannel
将关闭所有底层连接,通道将进入终止状态。
ManagedChannel 的设计类似于 ExecutorService
。您可以做的一件事是在循环中调用 awaitTermination 以确保您确实正确关闭:
while (!channel.awaitTermination(5, TimeUnit.Second)) {
System.err.println("Still not terminated.");
}
我在连接到 NodeJS 服务器的 GRPC 客户端上使用 GRPC 版本:1.1.2 & JDK version: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 日)。
secure_endpoint.c 在 grpc
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;
}
ManagedChannel.shutdown()
向服务器指示不应再启动新的 RPC。所有现有的 RPC,尤其是流式 RPC 将继续 运行。一旦所有这些 RPC 完成,ManagedChannel
将关闭所有底层连接,通道将进入终止状态。
ManagedChannel 的设计类似于 ExecutorService
。您可以做的一件事是在循环中调用 awaitTermination 以确保您确实正确关闭:
while (!channel.awaitTermination(5, TimeUnit.Second)) {
System.err.println("Still not terminated.");
}