Apr 23, 2012 at 2:10 PM
Edited Apr 23, 2012 at 2:12 PM
|
Hi,
We configure the server in code using the CertificateConfig object. This object only allows for a FilePath configuration.
We've extended CertificateConfig with the following property:
X509Certificate Certificate { get; }
And change CertificateManager to look like this:
internal static X509Certificate Initialize(ICertificateConfig cerConfig)
{
X509Certificate cert;
//Handle a certificate from the store first
if (cerConfig.Certificate == null)
{
//To keep compatible with website hosting
string filePath;
if (Path.IsPathRooted(cerConfig.FilePath))
filePath = cerConfig.FilePath;
else
{
filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, cerConfig.FilePath);
}
cert = new X509Certificate2(filePath, cerConfig.Password);
}
else
{
cert= cerConfig.Certificate;
}
return cert;
}
However, I think it would be better that SuperSocket did it out of the box.
What do you think?
Thanks
|