public async Task RunTest()
{
bool done = false;
while (!done)
{
try
{
using (TcpClient requestClient = await _listener.AcceptTcpClientAsync())
{
_log.WriteLine("[Server] Client connected.");
using (var tls = new SslStream(requestClient.GetStream()))
{
await tls.AuthenticateAsServerAsync(
_serverCertificate,
false,
_protocols,
false);
_log.WriteLine("[Server] Client authenticated.");
done = await HttpConversation(tls);
}
}
}
catch (IOException)
{
// Ignore I/O issues as browsers attempt to connect only to detect crypto information.
}
}
_listener.Stop();
}