Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在Asp.net核心Web应用程序中实现https(SSL证书)_C#_Ssl - Fatal编程技术网

C# 在Asp.net核心Web应用程序中实现https(SSL证书)

C# 在Asp.net核心Web应用程序中实现https(SSL证书),c#,ssl,C#,Ssl,我正在为asp.net核心web应用程序实现“https”。以下是我这样做的原因: 安装nuget软件包:Microsoft.AspNetCore.Server.Kestrel.Https .UseKestrel(options=>{options.listenyip(5556,listenOptions=>{listenOptions.UseHttps(“d:\\my-cert.pfx”,“password”);})。useURL(https://FQDN:5556) 出现错误: System

我正在为asp.net核心web应用程序实现“https”。以下是我这样做的原因:

  • 安装nuget软件包:
    Microsoft.AspNetCore.Server.Kestrel.Https
  • .UseKestrel(options=>{options.listenyip(5556,listenOptions=>{listenOptions.UseHttps(“d:\\my-cert.pfx”,“password”);})。useURL(https://FQDN:5556)
  • 出现错误:

    System.Security.Cryptography.CryptographyException:“访问被拒绝 但我有管理员权限

    我这里有两个问题:

  • 如何以加密方式发送密码
  • 我的应用程序应该同时适用于HTTP和HTTPS。有人能推荐一种不用IIS配置的实现方法吗
  • 稍后我将在
    config.json
    文件中指定证书和密码

    "app": {
        "programmPath": "C:\\webapp",
        "webserver": "https://FQDN:5556",
        "Cert" : "my-cert.pfx",
        "pwd":"password"  -> this will be exposed, how to handle this?
    }