[Modify] Polish it

master
sta 9 years ago
parent 37a38b3d26
commit b23054594d

@ -836,17 +836,19 @@ namespace WebSocketSharp.Server
if (!_secure) if (!_secure)
return true; return true;
var user = _listener.SslConfiguration.ServerCertificate != null; var byUser = _listener.SslConfiguration.ServerCertificate != null;
var path = _listener.CertificateFolderPath; var path = _listener.CertificateFolderPath;
var port = EndPointListener.CertificateExists (_port, path); var withPort = EndPointListener.CertificateExists (_port, path);
if (user && port) { var both = byUser && withPort;
if (both) {
_log.Warn ("The certificate associated with the port will be used."); _log.Warn ("The certificate associated with the port will be used.");
return true; return true;
} }
if (!(user || port)) { var either = byUser || withPort;
if (!either) {
message = "There is no certificate used to authenticate the server."; message = "There is no certificate used to authenticate the server.";
return false; return false;
} }

Loading…
Cancel
Save