1

I have register ssl certificates for server. Insert all certs to /usr/local/share/ca-certificates/ and make update-ca-certificates.

When app start, I follow by url https_//www.site.org:443 but its not loading.

 static void Main(string[] args)
        {
            var uri = "https://localhost:443";
            var host = new NancyHost(new Uri(uri));
            host.Start();  // start hosting

            if (args.Any(s => s.Equals("-d", StringComparison.CurrentCultureIgnoreCase)))
            {
                Thread.Sleep(Timeout.Infinite);
            }
            else
            {
                Trictionary.initilizeDic();
                Console.ReadKey();
            }

            host.Stop();  // stop hosting
        }

enter image description here

mehelta
  • 89
  • 1
  • 10

1 Answers1

1

Nancy console hosting doesn't support ssl itself, so in order to have ssl, you need to run another web server, which does support ssl. I don't know which OS you use, but let's say it is ubuntu for example. On ubuntu you can run nginx with ssl, like described here and then use proxy_pass to send decrypted request to your console app. Official documentation explains how to set up nginx and nancy combination. Your basic scenario would be:

  1. Set up Nancy Console App
  2. Set up and configure ssl enabled web server to pass requests to your nancy app
  3. Use some control app to make sure that both of them alive all the time
Igor Yalovoy
  • 1,715
  • 1
  • 17
  • 22