Nancyfx self hosting over HTTPS

后端 未结 2 840
面向向阳花
面向向阳花 2021-02-10 13:52

I tried to start a nancyfx webserver in self hosting mode. Everything works fine when executing the following code:

 public static void Main(string[] args)
 {
           


        
相关标签:
2条回答
  • 2021-02-10 14:13

    I've got it working. I've found it useful to have a number of checks in the process.

    CHECK1 - Was the certificate added correctly? (using Certificate Management MMC snap-in correctly):

    • After you install the cert on the machine run certutil -store MY
    • You should see the cert details there (sha/user created/name etc)
    • If not STOP. You probably imported into the user store (or the cert is invalid). You MUST start with empty mmc and import certificates for the MACHINE.

    CHECK2 - Was the url added to urlacl list in netsh correctly? (using netsh http add urlacl)?:

    • After you add the uri to acl run netsh http show urlacl
    • If your uri / port is not listed STOP. The url isn't added correctly.

    CHECK3 - Was ssl bound to urlacl ? (using netsh http add sslcert)

    • After running the add sslcert command run netsh http show sslcert
    • If your port/sha combination is not listed then check the sha has no spaces / appid is unique / app id + braces surrounded by quotes (if executing from PS)

    Hope it helps. I created the above after 6 hours of head banging. It now works!

    0 讨论(0)
  • 2021-02-10 14:18

    maybe you missed SSL cert config and url acl config.

    Check this post : https://coderead.wordpress.com/2014/08/07/enabling-ssl-for-self-hosted-nancy/

    0 讨论(0)
提交回复
热议问题