[Modify] Remove it and throw exception

This commit is contained in:
sta 2017-10-15 14:45:22 +09:00
parent bbc70c5314
commit 4c9f443bea

View File

@ -651,23 +651,20 @@ namespace WebSocketSharp
/// </value> /// </value>
public ClientSslConfiguration SslConfiguration { public ClientSslConfiguration SslConfiguration {
get { get {
return _client if (!_client) {
? (_sslConfig ?? (_sslConfig = new ClientSslConfiguration (_uri.DnsSafeHost))) var msg = "This instance is not a client.";
: null; throw new InvalidOperationException (msg);
} }
set { if (!_secure) {
lock (_forState) { var msg = "The connection is not secure.";
string msg; throw new InvalidOperationException (msg);
if (!checkIfAvailable (true, false, true, false, false, true, out msg)) {
_logger.Error (msg);
error ("An error has occurred in setting the ssl configuration.", null);
return;
} }
_sslConfig = value; if (_sslConfig == null)
} _sslConfig = new ClientSslConfiguration (_uri.DnsSafeHost);
return _sslConfig;
} }
} }