【发布时间】:2017-04-11 08:19:02
【问题描述】:
我为我的 DSC 网络拉取服务器创建了一个域证书(由我的内部 CA 颁发)并检索了指纹。
我从 inetmgr 导出证书并将其安装在拉取服务器(本地计算机和用户)上。
然后我将指纹放入脚本的 CertificateThumbprint 参数中。
但是,当我重新运行配置脚本以生成新的 MOF 并重新启动 DSC 配置时,我仍然只能通过 http 而不是 https 访问该站点。
当我尝试使用 https 导航到拉取服务器站点时,我收到 TLS 警告。 (我在 Windows Server 2016,PS 版本 5.1)
干杯
编辑:
下面是生成带有指纹的 MOF 的脚本。
configuration CreatePullServer
{
param
(
[string[]]$ComputerName = 'localhost'
)
Import-DSCResource -ModuleName xPSDesiredStateConfiguration
Import-DscResource -ModuleName PSDesiredStateConfiguration
Node $ComputerName
{
WindowsFeature DSCServiceFeature
{
Ensure = "Present"
Name = "DSC-Service"
}
xDSCWebService PSDSCPullServer
{
Ensure = "Present"
EndpointName = "PSDSCPullServer"
AcceptSelfSignedCertificates = $true
Port = 8080
PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer"
CertificateThumbPrint = '881B26142BABAFEF7490FB1CD48EA1D572628087'
ModulePath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
ConfigurationPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"
State = "Started"
UseSecurityBestPractices = $True
DependsOn = "[WindowsFeature]DSCServiceFeature"
}
xDscWebService PSDSCComplianceServer
{
Ensure = "Present"
EndpointName = "PSDSCComplianceServer"
Port = 9080
PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCComplianceServer"
CertificateThumbPrint = 'AllowUnencryptedTraffic'
State = "Started"
UseSecurityBestPractices = $True
DependsOn = ("[WindowsFeature]DSCServiceFeature","[xDSCWebService]PSDSCPullServer")
}
}
}
CreatePullServer -ComputerName pullsrv01 -verbose
And here is an image of the TLS message when I try to navigate to the https site
【问题讨论】:
-
SO 不是脚本编写服务。请提供您自己的代码示例 - 以及您收到的错误消息。由于您遇到的问题与配置相关,我也认为 Serverfault 是解决这个问题的更好平台。
-
感谢您的建议,我现在已经修改了问题。我也会在 Serverfault 上发帖。干杯!
标签: powershell ssl dsc