[Modify] Polish it
This commit is contained in:
parent
5852d8dd25
commit
6774f5ae37
@ -193,15 +193,15 @@ namespace WebSocketSharp.Net
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static X509Certificate2 getCertificate (
|
private static X509Certificate2 getCertificate (
|
||||||
int port, string certificateFolderPath, X509Certificate2 defaultCertificate
|
int port, string folderPath, X509Certificate2 defaultCertificate
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (certificateFolderPath == null || certificateFolderPath.Length == 0)
|
if (folderPath == null || folderPath.Length == 0)
|
||||||
certificateFolderPath = _defaultCertFolderPath;
|
folderPath = _defaultCertFolderPath;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var cer = Path.Combine (certificateFolderPath, String.Format ("{0}.cer", port));
|
var cer = Path.Combine (folderPath, String.Format ("{0}.cer", port));
|
||||||
var key = Path.Combine (certificateFolderPath, String.Format ("{0}.key", port));
|
var key = Path.Combine (folderPath, String.Format ("{0}.key", port));
|
||||||
if (File.Exists (cer) && File.Exists (key)) {
|
if (File.Exists (cer) && File.Exists (key)) {
|
||||||
var cert = new X509Certificate2 (cer);
|
var cert = new X509Certificate2 (cer);
|
||||||
cert.PrivateKey = createRSAFromFile (key);
|
cert.PrivateKey = createRSAFromFile (key);
|
||||||
|
Loading…
Reference in New Issue
Block a user