[Modify] Polish them

This commit is contained in:
sta 2017-10-21 13:52:59 +09:00
parent 5221933e32
commit e1e40f97de

View File

@ -834,9 +834,6 @@ namespace WebSocketSharp.Server
{ {
message = null; message = null;
if (!_secure)
return true;
var byUser = _listener.SslConfiguration.ServerCertificate != null; var byUser = _listener.SslConfiguration.ServerCertificate != null;
var path = _listener.CertificateFolderPath; var path = _listener.CertificateFolderPath;
@ -844,13 +841,13 @@ namespace WebSocketSharp.Server
var both = byUser && withPort; var both = byUser && withPort;
if (both) { if (both) {
_log.Warn ("The certificate associated with the port will be used."); _log.Warn ("A server certificate associated with the port is used.");
return true; return true;
} }
var either = byUser || withPort; var either = byUser || withPort;
if (!either) { if (!either) {
message = "There is no certificate used to authenticate the server."; message = "There is no server certificate for secure connections.";
return false; return false;
} }
@ -1475,9 +1472,11 @@ namespace WebSocketSharp.Server
/// </exception> /// </exception>
public void Start () public void Start ()
{ {
if (_secure) {
string msg; string msg;
if (!checkCertificate (out msg)) if (!checkCertificate (out msg))
throw new InvalidOperationException (msg); throw new InvalidOperationException (msg);
}
start (); start ();
} }