private async void AuthenticateAsClientAsync(SslStream sslStream, SecurityOption securityOption)
        {
            try
            {
                await sslStream.AuthenticateAsClientAsync(HostName, securityOption.Certificates, securityOption.EnabledSslProtocols, false);
            }
            catch (Exception e)
            {
                EnsureSocketClosed();
                OnError(e);
                return;
            }

            OnSslStreamConnected(sslStream);
        }
 private async void AuthenticateAsClientAsync(SslStream sslStream, SecurityOption securityOption)
 {
     try
     {
         await sslStream.AuthenticateAsClientAsync(HostName, securityOption.Certificates, securityOption.EnabledSslProtocols, false);
     }
     catch(Exception e)
     {
         EnsureSocketClosed();
         OnError(e);
         return;
     }
     
     OnSslStreamConnected(sslStream);
 }