weixin_39590868
weixin_39590868
2021-01-11 12:34

SslStream.AuthenticateAsClient hangs forever on linux-arm

There seems to be an issue with SslStream on arm-linux platform i have tried publish with both netcore 2.2 and the .net core 3.0 preview 6, same result.

c#
private string Connect() {
            Console.WriteLine("Establing TCP Connection.");
            _tcpc = new TcpClient(_server, _port);
            _ssl = new SslStream(_tcpc.GetStream(), false);
            Console.WriteLine("SSL Handshake trying to validate certificate");
            System.Net.ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
            try
            {
                _ssl.AuthenticateAsClientAsync(_server).Wait();
            }
            catch (AuthenticationException e) {
                Console.WriteLine("Exception: {0}", e.Message);
            }
            //
            //Reset State
            _lastReqPrefix = null;
            _reqCount = 1;
            //
            return ReadServerGreeting();
        }

The call to _ssl.AuthenticateAsClientAsync(_server).Wait(); just hangs forever, no exception is thrown.

I'm trying to run this on Raspbian GNU/Linux 9

该提问来源于开源项目:dotnet/runtime

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

18条回答

为你推荐

换一换