The .NET HttpListener class allows you to configure a prefix such as:


meaning that the HttpListener listens on the any address and port 8080 over HTTPs instead of HTTP. On Windows, using HTTPs for HttpListener requires an additional setup of certificates and this tutorial is about accomplishing the same on Unix.

Creating Certificates

Certificates can be created using the openssl command.

First, create a key file:

openssl genrsa -des3 -out Corrade.pem

preferably, you should not enter any password, or remove it with:

openssl rsa -in Corrade.pem -out Corrade.nopass
mv Corrade.nopass Corrade.pem

then create a sign request:

openssl req -new -key Corrade.pem -out Corrade.csr

The key file, Corrade.pem must be converted to Windows format using pvktool. To do that, issue the command:

openssl rsa -in Corrade.pem -outform PVK -out Corrade.pvk -pvk-none

Registering the Certificate

The final step is to register the certificate with mono's httpcfg. For example, in case you have a HTTP prefix such as:


then you would issue:

httpcfg -add -port 8080 -pvk Corrade.pvk -cert Corrade.crt

After the certificate is installed, you can start using the HTTPs prefix.

unix/https_for_mono_httplistener.txt · Last modified: 2022/04/19 08:28 by

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key

For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.