Skip to content

Commit

Permalink
TLSv13
Browse files Browse the repository at this point in the history
  • Loading branch information
chronoxor committed Nov 28, 2022
1 parent 72881dd commit 6d0fef1
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion examples/HttpsClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL client context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);

// Create a new HTTPS client
var client = new HttpsClientEx(context, Dns.GetHostAddresses(address).FirstOrDefault(), port);
Expand Down
2 changes: 1 addition & 1 deletion examples/HttpsServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL server context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("server.pfx", "qwerty"));
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("server.pfx", "qwerty"));

// Create a new HTTP server
var server = new HttpsCacheServer(context, IPAddress.Any, port);
Expand Down
2 changes: 1 addition & 1 deletion examples/SslChatClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL client context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);

// Create a new SSL chat client
var client = new ChatClient(context, address, port);
Expand Down
2 changes: 1 addition & 1 deletion examples/SslChatServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL server context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("server.pfx", "qwerty"));
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("server.pfx", "qwerty"));

// Create a new SSL chat server
var server = new ChatServer(context, IPAddress.Any, port);
Expand Down
2 changes: 1 addition & 1 deletion examples/WssChatClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL client context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);

// Create a new TCP chat client
var client = new ChatClient(context, address, port);
Expand Down
2 changes: 1 addition & 1 deletion examples/WssChatServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL server context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("server.pfx", "qwerty"));
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("server.pfx", "qwerty"));

// Create a new WebSocket server
var server = new ChatServer(context, IPAddress.Any, port);
Expand Down
2 changes: 1 addition & 1 deletion performance/HttpsTraceClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL client context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);

// Create HTTPS clients
var httpsClients = new List<HttpsTraceClient>();
Expand Down
2 changes: 1 addition & 1 deletion performance/HttpsTraceServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL server context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("server.pfx", "qwerty"));
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("server.pfx", "qwerty"));

// Create a new HTTPS server
var server = new HttpsTraceServer(context, IPAddress.Any, port);
Expand Down
2 changes: 1 addition & 1 deletion performance/SslEchoClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static void Main(string[] args)
MessageToSend = new byte[size];

// Create and prepare a new SSL client context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);

// Create echo clients
var echoClients = new List<EchoClient>();
Expand Down
2 changes: 1 addition & 1 deletion performance/SslEchoServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL server context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("server.pfx", "qwerty"));
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("server.pfx", "qwerty"));

// Create a new echo server
var server = new EchoServer(context, IPAddress.Any, port);
Expand Down
2 changes: 1 addition & 1 deletion performance/SslMulticastClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static void Main(string[] args)
MessageToSend = new byte[size];

// Create and prepare a new SSL client context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);

// Create multicast clients
var multicastClients = new List<MulticastClient>();
Expand Down
2 changes: 1 addition & 1 deletion performance/SslMulticastServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL server context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("server.pfx", "qwerty"));
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("server.pfx", "qwerty"));

// Create a new echo server
var server = new MulticastServer(context, IPAddress.Any, port);
Expand Down
2 changes: 1 addition & 1 deletion performance/WssEchoClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static void Main(string[] args)
MessageToSend = new byte[size];

// Create and prepare a new SSL client context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);

// Create echo clients
var echoClients = new List<EchoClient>();
Expand Down
2 changes: 1 addition & 1 deletion performance/WssEchoServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL server context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("server.pfx", "qwerty"));
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("server.pfx", "qwerty"));

// Create a new echo server
var server = new EchoServer(context, IPAddress.Any, port);
Expand Down
2 changes: 1 addition & 1 deletion performance/WssMulticastClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static void Main(string[] args)
MessageToSend = new byte[size];

// Create and prepare a new SSL client context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);

// Create multicast clients
var multicastClients = new List<MulticastClient>();
Expand Down
2 changes: 1 addition & 1 deletion performance/WssMulticastServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void Main(string[] args)
Console.WriteLine();

// Create and prepare a new SSL server context
var context = new SslContext(SslProtocols.Tls12, new X509Certificate2("server.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var context = new SslContext(SslProtocols.Tls13, new X509Certificate2("server.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);

// Create a new echo server
var server = new MulticastServer(context, IPAddress.Any, port);
Expand Down
4 changes: 2 additions & 2 deletions tests/HttpsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public void HttpsServerTest()
int port = 8443;

// Create and prepare a new SSL server and client context
var server_context = new SslContext(SslProtocols.Tls12, new X509Certificate2("server.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var client_context = new SslContext(SslProtocols.Tls12, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var server_context = new SslContext(SslProtocols.Tls13, new X509Certificate2("server.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
var client_context = new SslContext(SslProtocols.Tls13, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);

// Create and start HTTPS server
var server = new HttpsCacheServer(server_context, IPAddress.Any, port);
Expand Down
4 changes: 2 additions & 2 deletions tests/SslTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public EchoSslClient(SslContext context, string address, int port) : base(contex

public static SslContext CreateContext()
{
return new SslContext(SslProtocols.Tls12, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
return new SslContext(SslProtocols.Tls13, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
}

protected override void OnConnected() { Connected = true; }
Expand Down Expand Up @@ -60,7 +60,7 @@ public EchoSslServer(SslContext context, IPAddress address, int port) : base(con

public static SslContext CreateContext()
{
return new SslContext(SslProtocols.Tls12, new X509Certificate2("server.pfx", "qwerty"));
return new SslContext(SslProtocols.Tls13, new X509Certificate2("server.pfx", "qwerty"));
}

protected override SslSession CreateSession() { return new EchoSslSession(this); }
Expand Down
4 changes: 2 additions & 2 deletions tests/WssTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public EchoWssClient(SslContext context, string address, int port) : base(contex

public static SslContext CreateContext()
{
return new SslContext(SslProtocols.Tls12, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
return new SslContext(SslProtocols.Tls13, new X509Certificate2("client.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
}

public override void OnWsConnecting(HttpRequest request)
Expand Down Expand Up @@ -72,7 +72,7 @@ public EchoWssServer(SslContext context, IPAddress address, int port) : base(con

public static SslContext CreateContext()
{
return new SslContext(SslProtocols.Tls12, new X509Certificate2("server.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
return new SslContext(SslProtocols.Tls13, new X509Certificate2("server.pfx", "qwerty"), (sender, certificate, chain, sslPolicyErrors) => true);
}

protected override SslSession CreateSession() { return new EchoWssSession(this); }
Expand Down

0 comments on commit 6d0fef1

Please sign in to comment.