Installing SSL Cert for Mono HttpListener on Ubuntu

Posted July 22, 2014 5.4k views


I am a linux rookie. I have started using DO instead of Amazon and am having a great time with it in general, but have run into a situation for which I could really use some help.

I have an Ubuntu droplet on which I have installed Mono and am successfully running a C# console app as an httplistener on port 1337. This works fine if I access it unsecured using http.

I created a free signed web certificate. I retrieved the pfx/p12 file for my cert from their site and tried to use httpcfg to install it. It looks like it installed correctly on port 1337, as I can see it using httpcfg -list, and changed my code to look at https on port 1337 instead of http on port 1337. With this configuration all I get using https is an SSL error.

I really want to run this app as a console app/httplistener as opposed to using Nginx and Mono FastCGI. If anyone can help point me in the right direction regarding any SSL cert steps I got wrong or missed altogether I would greatly appreciate it!


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

With this configuration all I get using https is an SSL error.

Can you post the full error?

Have you created an S/MIME certificate or a web server certificate?

The highlighted option is the one you want.

I would personally configure Mono to listen on e.g. (non-SSL) and use nginx or HAProxy for terminating the SSL connection and proxying them to Mono.

  • Hi Kamal and thanks for your reply.

    I did select Web Server as my certificate type. Any chance you can point me to a how-to on nginx direct to a mono console app? I have tried nginx and mono-fastCGI but couldn’t get that going either.


  • I’m not familiar with Mono but you can configure your app to listen on Once you’ve done that, you can install nginx and add a virtualhost that proxies request to your Mono app:

    server {
            listen   80; 
            root /var/www/;
            location / {
                    proxy_set_header X-Real-IP  $remote_addr;
                    proxy_set_header X-Forwarded-For $remote_addr;
                    proxy_set_header Host $host;


Thanks. I will give that a shot tonight or tomorrow. I started down that path and now have nginx running but it can’t find the ssl certs. I think it is a permissions issue on my certs folder.