diff --git a/EonaCat.Network.Tester/Program.cs b/EonaCat.Network.Tester/Program.cs index a529dd5..89d2019 100644 --- a/EonaCat.Network.Tester/Program.cs +++ b/EonaCat.Network.Tester/Program.cs @@ -123,7 +123,7 @@ internal class Program private static void StartServer(string serverUri, string certificatePath, string certificatePassword, string requiredPassword) { _server = new WSServer(serverUri); - _server.SslConfiguration.Certificate = new X509Certificate2(certificatePath, certificatePassword); + _server.SSL.Certificate = new X509Certificate2(certificatePath, certificatePassword); _server.AddEndpoint("/Welcome"); _server.Start(); } diff --git a/EonaCat.Network/System/Sockets/Web/Core/Context/TcpListenerWSContext.cs b/EonaCat.Network/System/Sockets/Web/Core/Context/TcpListenerWSContext.cs index ef6fa5e..30fee85 100644 --- a/EonaCat.Network/System/Sockets/Web/Core/Context/TcpListenerWSContext.cs +++ b/EonaCat.Network/System/Sockets/Web/Core/Context/TcpListenerWSContext.cs @@ -36,8 +36,7 @@ namespace EonaCat.Network /// The associated with the WebSocket connection. /// The WebSocket protocol negotiated during the connection. /// A boolean indicating whether the connection is secure. - /// The SSL configuration for secure connections. - /// The logger for logging. + /// The SSL config for secure connections. internal TcpListenerWSContext( TcpClient tcpClient, string protocol, diff --git a/EonaCat.Network/System/Sockets/Web/Core/Endpoints/EndPointListener.cs b/EonaCat.Network/System/Sockets/Web/Core/Endpoints/EndPointListener.cs index ea79fef..181c274 100644 --- a/EonaCat.Network/System/Sockets/Web/Core/Endpoints/EndPointListener.cs +++ b/EonaCat.Network/System/Sockets/Web/Core/Endpoints/EndPointListener.cs @@ -89,7 +89,7 @@ namespace EonaCat.Network public int Port => _endpoint.Port; /// - /// Gets the SSL configuration for the secure endpoint. + /// Gets the SSL config for the secure endpoint. /// public SSLConfigServer SSL { get; } diff --git a/EonaCat.Network/System/Sockets/Web/Core/Endpoints/EndPointManager.cs b/EonaCat.Network/System/Sockets/Web/Core/Endpoints/EndPointManager.cs index 7a68b13..e03d515 100644 --- a/EonaCat.Network/System/Sockets/Web/Core/Endpoints/EndPointManager.cs +++ b/EonaCat.Network/System/Sockets/Web/Core/Endpoints/EndPointManager.cs @@ -77,7 +77,7 @@ namespace EonaCat.Network endpoint, pref.IsSecure, listener.CertificateFolderPath, - listener.SslConfiguration, + listener.SSL, listener.ReuseAddress ); diff --git a/EonaCat.Network/System/Sockets/Web/Core/Http/HttpListener.cs b/EonaCat.Network/System/Sockets/Web/Core/Http/HttpListener.cs index 7725603..54f0427 100644 --- a/EonaCat.Network/System/Sockets/Web/Core/Http/HttpListener.cs +++ b/EonaCat.Network/System/Sockets/Web/Core/Http/HttpListener.cs @@ -154,7 +154,7 @@ namespace EonaCat.Network } } - public SSLConfigServer SslConfiguration + public SSLConfigServer SSL { get { diff --git a/EonaCat.Network/System/Sockets/Web/Core/SSLConfig/SSLConfigClient.cs b/EonaCat.Network/System/Sockets/Web/Core/SSLConfig/SSLConfigClient.cs index e8e80ac..93fb22f 100644 --- a/EonaCat.Network/System/Sockets/Web/Core/SSLConfig/SSLConfigClient.cs +++ b/EonaCat.Network/System/Sockets/Web/Core/SSLConfig/SSLConfigClient.cs @@ -25,19 +25,19 @@ namespace EonaCat.Network SslProtocols = SslProtocols.Tls12; } - public SSLConfigClient(SSLConfigClient configuration) + public SSLConfigClient(SSLConfigClient sslConfig) { - if (configuration == null) + if (sslConfig == null) { - throw new ArgumentNullException(nameof(configuration)); + throw new ArgumentNullException(nameof(sslConfig)); } - CheckForCertificateRevocation = configuration.CheckForCertificateRevocation; - _clientCertSelectionCallback = configuration._clientCertSelectionCallback; - _clientCertificates = configuration._clientCertificates; - SslProtocols = configuration.SslProtocols; - _serverCertValidationCallback = configuration._serverCertValidationCallback; - TargetHost = configuration.TargetHost; + CheckForCertificateRevocation = sslConfig.CheckForCertificateRevocation; + _clientCertSelectionCallback = sslConfig._clientCertSelectionCallback; + _clientCertificates = sslConfig._clientCertificates; + SslProtocols = sslConfig.SslProtocols; + _serverCertValidationCallback = sslConfig._serverCertValidationCallback; + TargetHost = sslConfig.TargetHost; } public bool CheckForCertificateRevocation { get; set; } diff --git a/EonaCat.Network/System/Sockets/Web/Core/SSLConfig/SSLConfigServer.cs b/EonaCat.Network/System/Sockets/Web/Core/SSLConfig/SSLConfigServer.cs index 1ee55f4..e57621f 100644 --- a/EonaCat.Network/System/Sockets/Web/Core/SSLConfig/SSLConfigServer.cs +++ b/EonaCat.Network/System/Sockets/Web/Core/SSLConfig/SSLConfigServer.cs @@ -23,18 +23,18 @@ namespace EonaCat.Network SslProtocols = SslProtocols.Tls12; } - public SSLConfigServer(SSLConfigServer configuration) + public SSLConfigServer(SSLConfigServer sslConfig) { - if (configuration == null) + if (sslConfig == null) { - throw new ArgumentNullException(nameof(configuration)); + throw new ArgumentNullException(nameof(sslConfig)); } - CheckForCertificateRevocation = configuration.CheckForCertificateRevocation; - IsClientCertificateRequired = configuration.IsClientCertificateRequired; - _clientCertificationValidationCallback = configuration._clientCertificationValidationCallback; - SslProtocols = configuration.SslProtocols; - Certificate = configuration.Certificate; + CheckForCertificateRevocation = sslConfig.CheckForCertificateRevocation; + IsClientCertificateRequired = sslConfig.IsClientCertificateRequired; + _clientCertificationValidationCallback = sslConfig._clientCertificationValidationCallback; + SslProtocols = sslConfig.SslProtocols; + Certificate = sslConfig.Certificate; } public bool CheckForCertificateRevocation { get; set; } diff --git a/EonaCat.Network/System/Sockets/Web/Server/HttpServer.cs b/EonaCat.Network/System/Sockets/Web/Server/HttpServer.cs index 31df1be..42eb020 100644 --- a/EonaCat.Network/System/Sockets/Web/Server/HttpServer.cs +++ b/EonaCat.Network/System/Sockets/Web/Server/HttpServer.cs @@ -283,7 +283,7 @@ namespace EonaCat.Network } } - public SSLConfigServer SslConfiguration + public SSLConfigServer SSL { get { @@ -293,7 +293,7 @@ namespace EonaCat.Network throw new InvalidOperationException(message); } - return _listener.SslConfiguration; + return _listener.SSL; } } @@ -411,7 +411,7 @@ namespace EonaCat.Network { message = null; - var byUser = _listener.SslConfiguration.Certificate != null; + var byUser = _listener.SSL.Certificate != null; var path = _listener.CertificateFolderPath; var withPort = EndPointListener.CertificateExists(Port, path); diff --git a/EonaCat.Network/System/Sockets/Web/Server/WSServer.cs b/EonaCat.Network/System/Sockets/Web/Server/WSServer.cs index d6f532b..9088118 100644 --- a/EonaCat.Network/System/Sockets/Web/Server/WSServer.cs +++ b/EonaCat.Network/System/Sockets/Web/Server/WSServer.cs @@ -253,7 +253,7 @@ namespace EonaCat.Network } } - public SSLConfigServer SslConfiguration + public SSLConfigServer SSL { get { @@ -263,7 +263,7 @@ namespace EonaCat.Network throw new InvalidOperationException(message); } - return GetSslConfiguration(); + return GetSSLConfig(); } } @@ -366,13 +366,12 @@ namespace EonaCat.Network || name == _hostname; } - private static bool CheckSslConfiguration( - SSLConfigServer configuration, out string message + private static bool CheckSslConfig(SSLConfigServer sslConfig, out string message ) { message = null; - if (configuration.Certificate == null) + if (sslConfig.Certificate == null) { message = "There is no server certificate for secure connections."; return false; @@ -387,7 +386,7 @@ namespace EonaCat.Network return realm != null && realm.Length > 0 ? realm : _defaultRealm; } - private SSLConfigServer GetSslConfiguration() + private SSLConfigServer GetSSLConfig() { _sslConfig ??= new SSLConfigServer(); @@ -705,9 +704,9 @@ namespace EonaCat.Network if (IsSecure) { - sslConfig = new SSLConfigServer(GetSslConfiguration()); + sslConfig = new SSLConfigServer(GetSSLConfig()); - if (!CheckSslConfiguration(sslConfig, out string message)) + if (!CheckSslConfig(sslConfig, out string message)) { throw new InvalidOperationException(message); } diff --git a/EonaCat.Network/System/Tools/FileReader.cs b/EonaCat.Network/System/Tools/FileReader.cs index 2bd2ca6..0ddb13a 100644 --- a/EonaCat.Network/System/Tools/FileReader.cs +++ b/EonaCat.Network/System/Tools/FileReader.cs @@ -10,7 +10,7 @@ namespace EonaCat.Network public class FileReader { /// - /// Read a configuration file (varName=varValue format #beginning with comments) + /// Reads a configuration file (varName=varValue format #beginning with comments) /// /// Parameter list. /// File path.