Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8855373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:07:14+00:00 2026-06-14T14:07:14+00:00

Is SSL supported on Service Stack on Mono? I only have access to a

  • 0

Is SSL supported on Service Stack on Mono?

I only have access to a mac and the instructions I found here ask you to use a windows tool to create a pvk file:
http://joshua.perina.com/geo/post/using-ssl-https-with-mono-httplistener

The site is hosted as a linux daemon process using an upstart script to keep the server up.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:07:15+00:00Added an answer on June 14, 2026 at 2:07 pm

    I ended up writing some code in my app host to enable SSL support for Service Stack, which uses HttpListener under the covers. Here is some code that will enable SSL for Service Stack for a console application:

    public class AppHost : AppHostHttpListenerBase
    {
        public AppHost() : base("Service", typeof(AppHost).Assembly) 
        {
        }
    
        public override void Configure(Funq.Container container)
        {
            Plugins.Add(new RazorFormat());
        }
    
        static void AddP12 (string filename, string password, ushort port)
        {
            string dirname = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            string path = Path.Combine(dirname, ".mono");
            path = Path.Combine(path, "httplistener");
            if (!Directory.Exists(path))
            {
                Console.WriteLine("Creating directory: " + path);
                Directory.CreateDirectory(path);
            }
            X509Certificate2 x509 = null;
            try {
                x509 = new X509Certificate2 (filename, password);
            } catch (Exception e) {
                Console.Error.WriteLine ("error loading certificate [{0}]", e.Message);
                return;
            }
    
            string target_cert = Path.Combine (path, String.Format ("{0}.cer", port));
            if (File.Exists(target_cert)) 
            {
                Console.Error.WriteLine ("error: there is already a certificate for that port.");
                return;
            }
            string target_pvk = Path.Combine (path, String.Format ("{0}.pvk", port));
            if (File.Exists(target_pvk)) {
                Console.Error.WriteLine ("error: there is already a certificate for that port.");
                return;
            }
    
            using (Stream cer = File.OpenWrite (target_cert)) 
            {
                byte[] raw = x509.RawData;
                cer.Write (raw, 0, raw.Length);
            }
    
            PrivateKey pvk = new PrivateKey();
            pvk.RSA = x509.PrivateKey as RSA;
            pvk.Save(target_pvk);           
        }
    
        public static void Main(string[] args)
        {
            string listeningOn = string.Empty;
            if (args.Length == 1)
                listeningOn = "http://*:" + args[0] + "/";
            else if (args.Length == 3)
            {
                listeningOn = "https://*:" + args[0] + "/";
                AddP12(args[1], args[2], Convert.ToUInt16(args[0]));
            }
            else
            {
                Console.WriteLine("Usage: [port] [p12 certificate] [p12 password]");
                return;
            }
            AppHost appHost = new AppHost();
            appHost.Init();
            appHost.Start(listeningOn);
            Console.WriteLine("Service Stack Server started at {0}, listening on {1}", DateTime.Now, listeningOn);
            while (true) System.Threading.Thread.Sleep(100);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C# Web service which is running under IIS 7.5 on Windows
I have a WCF Service with wsHttpBindings and SSL enabled, but I'd like to
Upgraded Webbit to 0.4.6 to use the new SSL support but immediately realized that
I use apache/passenger on my development machine, but need to add SSL support (something
I have set up the Apache tomcat 5 to support ssl. Created self signed
I installed rack ssl for Rails 3.07 per these instructions: http://www.simonecarletti.com/blog/2011/05/configuring-rails-3-https-ssl/ It is not
I found some manual here : http://support.microsoft.com/kb/316898/ru but can't make a step with :
I am implementing CAS for Single Sign on Authentication, I have used SSL for
I have a web project that used to use Forms Authentication. I have new
I have to call an HTTP service hosted on web server with an invalid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.