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

查看:302
本文介绍了从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


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

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. 打开发布配置文件( .pubxml )在文本编辑器的/ Properties / PublishProfiles内

  2. < PropertyGroup> 元素内,将AllowUntrustedCertificate设置为True(< AllowUntrustedCertificate> True< / AllowUntrustedCertificate> )或添加(如果不存在的话)

  3. 将UsePowerShell设置为False(< UsePowerShell> False< / UsePowerShell> )。

  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 文件中的模块版本

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天全站免登陆