• Sign In

Technology??

A site for testing the new tools I'm building, and a little talk about what I'm learning on the way.

  • Home
  • TechnologyView my occasional technology posts.
  • Life
  • Contact
« Sending Email from Amazon EC2
.NET MimeTypes Class in C# »

Using SSL (https) with Mono HTTPListener

test
Thursday, February 04, 2010


These steps took me a little while to figure out and didn't seem to be all in one place.

Using you GoDaddy or other signed certificate you can get mono httplistener working with ssl.  

Create the signing request:

Create a key file:

#openssl genrsa -des3 -out yourdomain.pem 2048

Optionally remove the password:

#openssl rsa -in yourdomain.pem -out yourdomain.pem.nopass

Create the certificate signing request.  Your certificate provider should have some instructions on what goes in each fields, but generally the domain name you want to secure goes in the Common Name field:

#openssl req -new -key yourdomain.pem.nopass -out yourdomain.csr

Once you have the cert file.  For example yourdomain.crt you must register the crt using the Mono utility httpcfg.  But first, you must convert your key file to the Microsoft Format .pvk or you will get this error: "error loading certificate or private key [Invalid data and/or password]"

pvktool can be downloaded to convert it.   You can find that here: http://www.drh-consultancy.demon.co.uk/pvk.html

Once you have it (either on Windows or Linux) run:
pvk -in yourdomain.pem.nopass -topvk -nocrypt -out yourdomain.pvk

Now register your signed certificate with httpcfg:

#httpcfg -add -port 443 -pvk yourdomain.pvk -cert yourdomain.crt

To see the current registrations:
#httpcfg -list 

If your listener is listening on port 443 you should now see your certificate on https.  










Comments
 
Joshua Perina - Tuesday, April 20, 2010 7:27 PM
Test Comment

Your Comment

Your Name

Your Location

To receive emails create a username or Sign In
Your Email
Username
Password
Confirm Password
Add me to the contact list.
Remember me on this computer.
Sign in below or Sign Up
Username
Password
loading...  Post Comment
 
Related Topics
mono, httplistener, httpcfg, ssl
Media Actions
0
Promote
Email to a friend
Inquire
Save to delicious
Digg this
Stumble it
See Also

Try Lara

Build your own website with Lara.  A powerful content management system with easy and fun to use design tools. 

Visit http://getlara.com to learn more.

Go here for a good Javascript Html Editor.

Subscribe Now

Recent Posts

  • VGA Planets "Nu" - The official VGA Planets remake
  • Sending Email from Amazon EC2
  • Using SSL (https) with Mono HTTPListener
  • .NET MimeTypes Class in C#
  • Great WordPress Plugins
  • Flash IO Error #2038 when Uploading Files in .NET
  • Javascript DOM Ready for SSL in IE
  • Javascript Replace All with Variable
  • New Projects for 2009 with News Statistics and Analysis
  • Google Chrome - it really is a better browser
Website created with Lara by Geographical Media