[Mono-list] SslStream.AuthenticateAsServer() private key issues
lists at peterschen.de
lists at peterschen.de
Fri Feb 15 07:58:00 EST 2008
Hi,
>> I'm porting a application I started to develop on Windows to Linux. On
>> Windows I can link the private key in the Storage and the application
>> (or better: the authentication) works fine.
>
> Could you provide more information about what is "Storage" since this is
> not a framework class ?
Storage is the internal Windows certificate storage where all the
certificates are placed you possible can use. You can access this
storage via the MMC. With Mono this is a directory managed by the
certmgr tool which can import certificates.
>> In several attempts to get the stuff running I tried a lot of
>> different Storages and it seems that he just "forgets" to import the
>> private key. Are there any hints how I can import the private key in
>> order to get my app running?
>
> Please supply a (as small as possible) test case that works on MS.NET.
> It will make it a lot easier to see if, and where, the problem may be.
I can tell you where the problem lies. Mono raises an error
complaining that there was no private key for the server certificate
found. I'm using PEM formatted certificates on Linux created by
OpenSSL. I also tried PKCS#12 but the same result. The following line
is responsible for importing the actual certificate for the server
application.
serverCertificate = X509Certificate2.CreateFromCertFile("./certificate.crt");
Hope this helps a bit.
BR
Christoph
More information about the Mono-list
mailing list