[Modify] Remove it and throw exception
This commit is contained in:
parent
bbc70c5314
commit
4c9f443bea
@ -651,23 +651,20 @@ namespace WebSocketSharp
|
||||
/// </value>
|
||||
public ClientSslConfiguration SslConfiguration {
|
||||
get {
|
||||
return _client
|
||||
? (_sslConfig ?? (_sslConfig = new ClientSslConfiguration (_uri.DnsSafeHost)))
|
||||
: null;
|
||||
if (!_client) {
|
||||
var msg = "This instance is not a client.";
|
||||
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;
|
||||
if (!_secure) {
|
||||
var msg = "The connection is not secure.";
|
||||
throw new InvalidOperationException (msg);
|
||||
}
|
||||
|
||||
_sslConfig = value;
|
||||
}
|
||||
if (_sslConfig == null)
|
||||
_sslConfig = new ClientSslConfiguration (_uri.DnsSafeHost);
|
||||
|
||||
return _sslConfig;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user