[Modify] Polish it

This commit is contained in:
sta 2016-06-08 14:58:30 +09:00
parent 5852d8dd25
commit 6774f5ae37

View File

@ -193,15 +193,15 @@ namespace WebSocketSharp.Net
}
private static X509Certificate2 getCertificate (
int port, string certificateFolderPath, X509Certificate2 defaultCertificate
int port, string folderPath, X509Certificate2 defaultCertificate
)
{
if (certificateFolderPath == null || certificateFolderPath.Length == 0)
certificateFolderPath = _defaultCertFolderPath;
if (folderPath == null || folderPath.Length == 0)
folderPath = _defaultCertFolderPath;
try {
var cer = Path.Combine (certificateFolderPath, String.Format ("{0}.cer", port));
var key = Path.Combine (certificateFolderPath, String.Format ("{0}.key", port));
var cer = Path.Combine (folderPath, String.Format ("{0}.cer", port));
var key = Path.Combine (folderPath, String.Format ("{0}.key", port));
if (File.Exists (cer) && File.Exists (key)) {
var cert = new X509Certificate2 (cer);
cert.PrivateKey = createRSAFromFile (key);