diff --git a/websocket-sharp/Net/ServerSslConfiguration.cs b/websocket-sharp/Net/ServerSslConfiguration.cs
index b1086988..9920b8c0 100644
--- a/websocket-sharp/Net/ServerSslConfiguration.cs
+++ b/websocket-sharp/Net/ServerSslConfiguration.cs
@@ -44,12 +44,15 @@ namespace WebSocketSharp.Net
/// Stores the parameters used to configure the underlying
/// for servers.
///
- public class ServerSslConfiguration : SslConfiguration
+ public class ServerSslConfiguration
{
#region Private Fields
- private X509Certificate2 _serverCert;
- private bool _clientCertRequired;
+ private bool _checkCertRevocation;
+ private bool _clientCertRequired;
+ private RemoteCertificateValidationCallback _clientCertValidationCallback;
+ private SslProtocols _enabledSslProtocols;
+ private X509Certificate2 _serverCert;
#endregion
@@ -97,16 +100,35 @@ namespace WebSocketSharp.Net
SslProtocols enabledSslProtocols,
bool checkCertificateRevocation
)
- : base (enabledSslProtocols, checkCertificateRevocation)
{
_serverCert = serverCertificate;
_clientCertRequired = clientCertificateRequired;
+ _enabledSslProtocols = enabledSslProtocols;
+ _checkCertRevocation = checkCertificateRevocation;
}
#endregion
#region Public Properties
+ ///
+ /// Gets or sets a value indicating whether the certificate revocation
+ /// list is checked during authentication.
+ ///
+ ///
+ /// true if the certificate revocation list is checked during
+ /// authentication; otherwise, false.
+ ///
+ public bool CheckCertificateRevocation {
+ get {
+ return _checkCertRevocation;
+ }
+
+ set {
+ _checkCertRevocation = value;
+ }
+ }
+
///
/// Gets or sets a value indicating whether the client is asked for
/// a certificate for authentication.
@@ -144,11 +166,31 @@ namespace WebSocketSharp.Net
///
public RemoteCertificateValidationCallback ClientCertificateValidationCallback {
get {
- return CertificateValidationCallback;
+ if (_clientCertValidationCallback == null)
+ _clientCertValidationCallback = defaultValidateClientCertificate;
+
+ return _clientCertValidationCallback;
+ }
+
+ set {
+ _clientCertValidationCallback = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the protocols used for authentication.
+ ///
+ ///
+ /// The enum values that represent the protocols
+ /// used for authentication.
+ ///
+ public SslProtocols EnabledSslProtocols {
+ get {
+ return _enabledSslProtocols;
}
set {
- CertificateValidationCallback = value;
+ _enabledSslProtocols = value;
}
}
@@ -170,5 +212,19 @@ namespace WebSocketSharp.Net
}
#endregion
+
+ #region Private Methods
+
+ private static bool defaultValidateClientCertificate (
+ object sender,
+ X509Certificate certificate,
+ X509Chain chain,
+ SslPolicyErrors sslPolicyErrors
+ )
+ {
+ return true;
+ }
+
+ #endregion
}
}