从 Visual Studio 2015 发布 - 允许不受信任的证书 [英] Publishing from Visual Studio 2015 - allow untrusted certificates

查看:40
本文介绍了从 Visual Studio 2015 发布 - 允许不受信任的证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从 Visual Studio 2015 发布我的 ASP.NET 5 MVC6 项目.我已经从我的服务器导入了发布配置文件.连接验证成功,但是当我发布我的项目时出现以下错误:

I am publishing my ASP.NET 5 MVC6 project from Visual Studio 2015. I have imported publish profile from my server. Connection validates successfully, however when I publish my project I have the following error:

ERROR_CERTIFICATE_VALIDATION_FAILED

ERROR_CERTIFICATE_VALIDATION_FAILED

使用指定的连接到远程计算机(XXXXXXXXX")进程(Web 管理服务"),但无法验证服务器的证书.如果您信任服务器,请再次连接并允许不受信任的证书.

Connected to the remote computer ("XXXXXXXXX") 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.

在发布设置中没有允许不受信任的证书的选项.

There is no option to allow untrusted certificates in publishing settings.

推荐答案

当前工具尚不支持允许不受信任证书的选项.希望这会很快更新.但是,您可以手动设置.

The option to allow untrusted certificates is not yet supported in the current tooling. Hopefully, this gets updated very soon. You can, however, set it manually.

  1. 在文本编辑器中打开/Properties/PublishProfiles 中的发布配置文件 (.pubxml)
  2. 元素中,将 AllowUntrustedCertificate 设置为 True(True),如果不存在则添加它
  3. 将 UsePowerShell 设置为 False (False).
  1. Open the publish profile file (.pubxml) inside /Properties/PublishProfiles in a text editor
  2. Inside the <PropertyGroup> element, set AllowUntrustedCertificate to True (<AllowUntrustedCertificate>True</AllowUntrustedCertificate>) or add it if it doesn't exist
  3. Set UsePowerShell to False (<UsePowerShell>False</UsePowerShell>).

在撰写本文时,生成的 powershell 脚本忽略了 AllowUntrustedCertificate 属性,这可能是一个错误,因此需要将其设置为 False.

At this time of writing, the generated powershell script disregards the AllowUntrustedCertificate property which is probably a bug, hence, the need to set it to False.

如果您在 .ps1 中更新模块版本,您可以使 powershell 工作代码>文件.

You can get powershell to work if you update the module version in the .ps1 file.

附带说明,您也可以通过在本地信任"服务器的证书来解决此问题.

As a side note, you can also get around this problem by "trusting" the server's certificate locally.

这篇关于从 Visual Studio 2015 发布 - 允许不受信任的证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆