wechaty / dotnet-wechaty

.NET Wechaty is a Conversational SDK for Chatbot Makers Written in C#
Apache License 2.0
81 stars 29 forks source link

HttpRequestException: The SSL connection could not be established, see inner exception. #35

Closed stw666 closed 2 years ago

stw666 commented 2 years ago

运行项目报错,好像跟SSL有关

  fail: Wechaty.Module.Puppet.WechatyPuppet[0]
  StartGrpcClient() exception,Grpc Retry Surplus Count 3
  Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="Error starting gRPC call. HttpRequestException: 
  The SSL connection could not be established, see inner exception. IOException: Cannot determine the frame size or a corrupted frame was received.", DebugException="System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
   ---> System.IO.IOException: Cannot determine the frame size or a corrupted frame was received.
     at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](TIOAdapter adapter)
     at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
     at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
     --- End of inner exception stack trace ---
     at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
     at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
     at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
     at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
     at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
     at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)")
     at Wechaty.Module.PuppetService.GrpcPuppet.StartGrpc()

这是配置文件

     WECHATY_LOG="verbose"
     export WECHATY_PUPPET="wechaty-puppet-padlocal"
     export WECHATY_PUPPET_PADLOCAL_TOKEN="puppet_padlocal_"
     export WECHATY_PUPPET_SERVICE_NO_SSL_UNSAFE_CLIENT=true
     export WECHATY_PUPPET_SERVER_PORT="9001"
     export WECHATY_TOKEN="1fe5f846-3cfb-401d-b20c"
     docker run \
       --name wechaty_puppet_service_token_gateway-no-ssl \
       -e WECHATY_LOG \
       -e WECHATY_PUPPET \
       -e WECHATY_PUPPET_PADLOCAL_TOKEN \
       -e WECHATY_PUPPET_SERVER_PORT \
       -e WECHATY_TOKEN \
       -e WECHATY_PUPPET_SERVICE_NO_SSL_UNSAFE_CLIENT \
       -p "$WECHATY_PUPPET_SERVER_PORT:$WECHATY_PUPPET_SERVER_PORT" \
       wechaty/wechaty:0.56
Jesn commented 2 years ago

@stw666 wechaty/wechaty:0.68 使用这个版本作为网关,dotnet-wechaty的配置文件里面的这个配置 WECHATY_ENDPOINThttps://开头 , 0.56版本的好像有问题,有时间排查下

stw666 commented 2 years ago

换成wechaty/wechaty:0.68可以运行了,非常感谢