Nov 26 2021 09:39 PM
I believe I have followed the necessary steps to spin up an HttpListener (C#), generate a self signed certificate, install the certificate into the certificate store, bind the certificate to the port and register the URL via netsh. However, at this point in time, my non-ssl/tls URL is working perfectly fine, but the HTTPS url is simply returning a connection refused error.
My steps:
makecert -r -pe -n "CN=mysubdomain.mydomain.co.za" -sky exchange test.cer -sv test.pvk
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\pvk2pfx.exe" -pvk test.pvk -spc test.cer -pfx test.pfx
Installing certificate via MMC (Certificate Snap In) into both Personal Store and Trusted Root Certification Authorities. It clearly shows " You have a private key that corresponds to this certificate"
Registering the HTTP and HTTPS urls via commandline NETSH.
Binding the certificate to the port using
netsh http add sslcert ipport=0.0.0.0:8483 certhash=0bb6fec9fb940d4d5733cffa5108fa48f3d546b3 appid={D288F4CC-22B2-4F5C-86D8-CB23AB90F6CF}
both appid and certhash is correct. *use to get and error due to not having the private key imbedded into the certificate.
My verifications:
netsh http show urlacl | findstr 8483
yields
Reserved URL : https://+:8483/myurlpath/
netsh http show sslcert | findstr 8483
yields
IP:port : 0.0.0.0:8483
or more specifically
IP:port : 0.0.0.0:8483 Certificate Hash : 0bb6fec9fb940d4d5733cffa5108fa48f3d546b3 Application ID : {d288f4cc-22b2-4f5c-86d8-cb23ab90f6cf} Certificate Store Name : (null) Verify Client Certificate Revocation : Enabled Verify Revocation Using Cached Client Certificate Only : Disabled Usage Check : Enabled Revocation Freshness Time : 0 URL Retrieval Timeout : 0 Ctl Identifier : (null) Ctl Store Name : (null) DS Mapper Usage : Disabled Negotiate Client Certificate : Disabled Reject Connections : Disabled Disable HTTP2 : Not Set Disable QUIC : Not Set Disable TLS1.2 : Not Set Disable TLS1.3 : Not Set Disable OCSP Stapling : Not Set Enable Token Binding : Not Set Log Extended Events : Not Set Disable Legacy TLS Versions : Not Set Enable Session Ticket : Not Set
I would greatly appreciate some assistance in identifying what I've missed.
My expectation is that the URL is registered, the CERTIFICATE has been imported and bound to the port and that HTTPListener is starting up using a registered URL - however my error is ERR_CONNECTION_REFUSED