HTTPS Support for HttpListener

K.SeyboldK.Seybold DEMember

How can I configure the SSL certificate if I want to build an https server based on HttpListener.
The only information I found is here
http://www.codegur.net/13379963/httplistener-with-https-on-monotouch
but it doesn't work.

Any ideas?

Posts

  • Sadly the link is broken, any chance you got it working and could share how you did it?

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai

    My understanding is that you do not have to do anything special on the code end , except to make sure that your HttpListener object has the "https://..." prefix in the Prefixes property. E.g. do something like:

    httpListener.Prefixes.Add("https://*:443/");
    

    Which will set your HttpListener instance to listen for Https requests on port 443 (which is the standard https port).

    Beyond that, if you are using trusted certificates, then that should be all you have to do. If you want to use self-signed certificates, that is another can of worms... but I did find this SO post that may help with that as well:
    https://stackoverflow.com/a/11457719/2913599

Sign In or Register to comment.