【问题标题】:Grant Multiple IIS App Pools Permission to Same Certificate Using winhttpcertcfg使用 winhttpcertcfg 向同一证书授予多个 IIS 应用程序池权限
【发布时间】:2017-01-31 08:38:24
【问题描述】:

我需要为我的 IIS C# .NET 应用程序安装和授予访问权限以安全连接到 FirstData 的证书。我对证书了解不多,所以我正在运行如下所示的命令:

"C:\path\winhttpcertcfg" -i "WS10012NNN._.1.p12" -c LOCAL_MACHINE\MY -a "my-server-name\IIS APPPOOL\App1" -p <cert password>  
"C:\path\winhttpcertcfg" -i "WS10012NNN._.1.p12" -c LOCAL_MACHINE\MY -a "my-server-name\IIS APPPOOL\App2" -p <cert password>  
"C:\path\winhttpcertcfg" -i "WS10012NNN._.1.p12" -c LOCAL_MACHINE\MY -a "my-server-name\IIS APPPOOL\App3" -p <cert password>  
"C:\path\winhttpcertcfg" -i "WS10012NNN._.1.p12" -c LOCAL_MACHINE\MY -a "my-server-name\IIS APPPOOL\App4" -p <cert password>  
"C:\path\winhttpcertcfg" -i "WS10012NNN._.1.p12" -c LOCAL_MACHINE\MY -a "my-server-name\IIS APPPOOL\App5" -p <cert password>  

"C:\path\winhttpcertcfg" -g -c LOCAL_MACHINE\MY -s "WS10012NNN._.1" -a "my-server-name\IIS APPPOOL\App1"  
"C:\path\winhttpcertcfg" -g -c LOCAL_MACHINE\MY -s "WS10012NNN._.1" -a "my-server-name\IIS APPPOOL\App2"  
"C:\path\winhttpcertcfg" -g -c LOCAL_MACHINE\MY -s "WS10012NNN._.1" -a "my-server-name\IIS APPPOOL\App3"  
"C:\path\winhttpcertcfg" -g -c LOCAL_MACHINE\MY -s "WS10012NNN._.1" -a "my-server-name\IIS APPPOOL\App4"  
"C:\path\winhttpcertcfg" -g -c LOCAL_MACHINE\MY -s "WS10012NNN._.1" -a "my-server-name\IIS APPPOOL\App5"  

但是,这似乎没有按预期工作。实际上,我最终为 3 个应用程序池执行了上述操作,然后又为 2 个应用程序池执行了上述操作。我的一些站点不起作用,但如果我只为一个站点重新运行命令,它会破坏其他站点。看来我不能让所有 5 个同时工作。

似乎正确的顺序实际上应该是一个 -i 命令,然后是 5 个 -g 命令。但我不确定,我在网上找不到任何多站点示例。 如何正确授予我的所有 5 个应用程序池使用证书的权限?

【问题讨论】:

    标签: windows iis certificate winhttpcertcfg


    【解决方案1】:

    虽然我仍然不完全了解 winhttpcertcfg 及其开关的来龙去脉,但我能够解决我的问题。答案是先执行一个 -i 命令,然后执行所有 -g 命令。像这样:

    "C:\path\winhttpcertcfg" -i "WS10012NNN._.1.p12" -c LOCAL_MACHINE\MY -a "my-server-name\IIS APPPOOL\App1" -p <cert password> 
    
    "C:\path\winhttpcertcfg" -g -c LOCAL_MACHINE\MY -s "WS10012NNN._.1" -a "my-server-name\IIS APPPOOL\App1"  
    "C:\path\winhttpcertcfg" -g -c LOCAL_MACHINE\MY -s "WS10012NNN._.1" -a "my-server-name\IIS APPPOOL\App2"  
    "C:\path\winhttpcertcfg" -g -c LOCAL_MACHINE\MY -s "WS10012NNN._.1" -a "my-server-name\IIS APPPOOL\App3"  
    "C:\path\winhttpcertcfg" -g -c LOCAL_MACHINE\MY -s "WS10012NNN._.1" -a "my-server-name\IIS APPPOOL\App4"  
    "C:\path\winhttpcertcfg" -g -c LOCAL_MACHINE\MY -s "WS10012NNN._.1" -a "my-server-name\IIS APPPOOL\App5"  
    

    如果您对该证书再次执行“-i”命令,您的所有授权都将失效,您必须重做。所以基本上,一个安装命令,然后您的所有授权都指向该安装。如果您再次安装该证书,则必须再次授予所有内容。

    【讨论】:

      猜你喜欢
      • 2013-03-07
      • 1970-01-01
      • 2011-08-28
      • 2021-09-17
      • 2013-01-17
      • 2012-04-29
      • 2017-06-13
      • 2018-11-22
      • 1970-01-01
      相关资源
      最近更新 更多