简体   繁体   English

C#:不具有管理员权限的https上的HttpListener设置

[英]c#: HttpListener setup on https without admin rights

I want to use HttpListener for creating small https server listening on my custom port with self-signed certificates. 我想使用HttpListener创建带有自签名证书的自定义端口上侦听的小型https服务器。

I followed some tutorials and I can create Https server by using HttpListener But I must use admin rights for: 我遵循了一些教程,并且可以使用HttpListener创建Https服务器,但必须对以下内容使用管理员权限:

  1. Add certificate to local computer certificates (Trusted Root & Personal) 将证书添加到本地计算机证书(受信任的根和个人)
  2. Use "netsh http add sslcert" 使用“ netsh http add sslcert”

I'd like to setup Https without admin rights. 我想设置没有管理员权限的Https。 I know I can use TcpListener. 我知道我可以使用TcpListener。 With TcpListener I should only import CA certificate in my personal store. 使用TcpListener时,我只应在个人商店中导入CA证书。 It doesn't require admin rights. 它不需要管理员权限。 But there is need to parse http request manually. 但是需要手动解析http请求。

Is there any way to setup HttpListener without admin rights? 没有管理员权限,有没有办法设置HttpListener? Or use parser on tcp listener? 还是在TCP侦听器上使用解析器?

You need to grant permissions to the particular URL, for example: 您需要授予对特定URL的权限,例如:

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

please note the Documentation . 请注意文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM