[Modify] Remove it and throw exception
This commit is contained in:
parent
bbc70c5314
commit
4c9f443bea
@ -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 {
|
|
||||||
lock (_forState) {
|
|
||||||
string 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 (!_secure) {
|
||||||
|
var msg = "The connection is not secure.";
|
||||||
|
throw new InvalidOperationException (msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_sslConfig == null)
|
||||||
|
_sslConfig = new ClientSslConfiguration (_uri.DnsSafeHost);
|
||||||
|
|
||||||
|
return _sslConfig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user