首页 > 解决方案 > 为本地主机问题创建自签名证书?

问题描述

我正在尝试使用来自 youtube 的此视频的说明为 localhost 创建一个自签名证书:

https://www.youtube.com/watch?v=PttqtI8ml3E

坏消息是在我将此命令粘贴到 PowerShell 的第一步中:

PowerShell 命令:New-SelfSignedCertificate -Subject "localhost" -TextExtension @("2.5.29.17={text}DNS=localhost&IPAddress=127.0.0.1&IPAddress=::1")

我收到此错误:

在行:1 字符:99

  • ... bject localhost -TextExtension 2.5.29.17={text}DNS=localhost&IPAddres ...
  •                                                             ~ The ampersand (&) character is not allowed. The & operator is reserved
    

供将来使用;用双引号 ("&") 将 & 号括起来以将其作为字符串的一部分传递。在行:1 字符:119

  • ... tExtension 2.5.29.17={text}DNS=localhost&IPAddress=127.0.0.1&IPAddres ...
  •                                                             ~ The ampersand (&) character is not allowed. The & operator is reserved
    

供将来使用;用双引号 ("&") 将 & 号括起来以将其作为字符串的一部分传递。+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : AmpersandNotAllowed

我怎样才能解决这个问题?

标签: iiswindows-7ssl-certificate

解决方案


推荐阅读