Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c#: HttpListener setup on https without admin rights

Tags:

c#

.net

I want to use HttpListener for creating small https server listening on my custom port with self-signed certificates.

I followed some tutorials and I can create Https server by using HttpListener But I must use admin rights for:

  1. Add certificate to local computer certificates (Trusted Root & Personal)
  2. Use "netsh http add sslcert"

I'd like to setup Https without admin rights. I know I can use TcpListener. With TcpListener I should only import CA certificate in my personal store. It doesn't require admin rights. But there is need to parse http request manually.

Is there any way to setup HttpListener without admin rights? Or use parser on tcp listener?

like image 688
takayoshi Avatar asked Mar 17 '26 23:03

takayoshi


1 Answers

You need to grant permissions to the particular URL, for example:

netsh http add urlacl url="http://+:4200/" user=everyone

please note the Documentation.

like image 138
Barr J Avatar answered Mar 20 '26 12:03

Barr J



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!