msdeploy获取ERROR_CERTIFICATE_VALIDATION_FAILED,忽略allowUntrusted

Vin*_*ina 8 msdeploy

我正在使用msdeploy将网站代码推送到4个不同的服务器(测试和生产服务器).在前3个工作正常,但第4个给我一个ERROR_CERTIFICATE_VALIDATION_FAILED错误.我正在使用-allowUntrusted选项.

"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:iisApp="E:\workspace\testDeploy\outproject\_PublishedWebsites\<webfolder>" -dest:iisApp="mycompany.com",ComputerName="https://<hostip>:8172/MsDeploy.axd",UserName="<userid>",Password="****",AuthType="Basic" -allowUntrusted -enableRule:AppOffline -skip:objectName=filePath,absolutePath="^.*<webfolder>\\web.*\.config$|^.*mycompany\.com\\web.*\.config"

Error Code: ERROR_CERTIFICATE_VALIDATION_FAILED
More Infenter code hereormation: Connected to the remote computer ("<hostip>") using the specified process ("Web Management Service"), but could not verify the server's certificate. If you trust the server, connect again and allow untrusted certificates.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED.
Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Error: The remote certificate is invalid according to the validation procedure.
Run Code Online (Sandbox Code Playgroud)

知道我错过了什么吗?

spo*_*ahn 16

添加<AllowUntrustedCertificate>True</AllowUntrustedCertificate>到我的pubxml文件似乎最初解决了问题.

几天后重新发布,我得到了同样的错误.我进入了Publish Settings,重新输入了密码,发布成功了.

我现在认为我的初始问题是通过重新输入我的密码而不是通过添加来解决的<AllowUntrustedCertificate>True</AllowUntrustedCertificate>.

发布屏幕


Chr*_*ios 10

-allowUntrusted对我不起作用.

我用过这个:

/p:AllowUntrustedCertificate=True
Run Code Online (Sandbox Code Playgroud)


Sco*_*ttG 9

我通过进入发布设置解决了这个问题,然后单击底部的“验证连接”。然后这个错误就消失了。


Vin*_*ina 7

问题在于目标系统上用户的密码。

我在另一个帖子上看到有人-allowUntrusted-dest进入之前移动了旗帜。我试过了,我开始收到一条ERROR_USER_UNAUTHORIZED消息。输入密码时一切都正确,但它以*字符开头,并且还有一个单引号。我为没有使用这些特殊字符的用户生成了一个新密码,并在远程系统上更改了它。之后,一切正常。

我能够按照初始帖子中所示运行该命令而没有任何错误。

如果您得到ERROR_CERTIFICATE_VALIDATION_FAILEDERROR_USER_UNAUTHORIZED并且一切设置正确,请尝试更改目标系统上分配给用户的密码。似乎有些密码是行不通的。


dre*_*erk 6

添加此解决方案,因为其他解决方案都不适合我...

我必须添加这些行来发布配置文件:

<UseMSDeployExe>True</UseMSDeployExe>
<AllowUntrustedCertificate>True</AllowUntrustedCertificate>
Run Code Online (Sandbox Code Playgroud)

添加这些后,发布仍然失败。然后我打开发布配置文件设置,单击验证连接并保存。只有这样,发布才成功。