SSL Example?
Hey there, thanks for a great tool. I'd like to understand if/how I can serve files via HTTPS in the local network with Ceen, ideally with some automatic way of setting up a self-signed certificate (usecase is a small tool that will run on machines in the local network only). Are there any docs for SSL usage and certificate handling?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
There are no examples for this, but the support is using the X509Certificate2 class.
If you use this example as a starting point, you just need to set:
config.CertificatePassword = "certificate password";
config.CertificatePath = "./mycert.pfx";
Or in the config file:
set CertificatePassword "certificate password"
set CertificatePath "./mycert.pfx"
If you have an isolated process, you can restart the server with a new certificate, without loosing a connection, simply by modifying the config file.
If you are not using the config file, but the direct config instance, you can do:
config.SSLCertificate = new X509Certificate2(path, password);
If you are wondering how to create a .pfx file, you can use OpenSSL and create a certificate in the .p12 format. The exact instructions for how to do this, depends on your setup (who issues the root certificate, etc).