VS2017 RC Web deploy - ERROR_CERTIFICATE_VALIDATION_FAILED

2.8k views Asked by At

First, I upgraded my ASP.NET Core project to 1.1.0. That wasn't smooth at all. Now, when it works, I can't deploy it!

I deploy it to IIS (Windows Server 2012 R2) and I get the error saying

can't validate the certificate ... ERROR_CERTIFICATE_VALIDATION_FAILED!

I added this to my publishing profile:

<AllowUntrustedCertificate>True</AllowUntrustedCertificate>

but that doesn't work in VS2017 RC. So, how can I deploy now? Why you guys do not provide it from a start? This is an essential operation!

3

There are 3 answers

0
Ivan Yuriev On

The issue also appears when you are using wrong credentials: and\or stored password. To check this add into the pubxml file the following line:

<UseMsdeployExe>True</UseMsdeployExe>

this will switch from VSMSDeploy to MSDeploy - it got you more verbose with errors. If you store your password just remove the .pubxml.user file stored near .pubxml file and in Publish setting add the password once more.

1
Roger-江小鱼 On

Same here. Solved by creating a new publish profile.

0
Brian On

TL;DR

On the publish window, click on settings under summary, press summary and you will see the familiar publish dialog from VS 2015. Press validate connection and enter your credentials, making sure the success icon shows up. Now, try your publish profile from VS 2015, or a create a new one.

Note: After this step, having AllowTrustedCertificate set to true doesn't seem to matter.

Other Info:

I have a similar set up, working on Core 1.1 projects, working on a Windows 7 machine, and deploying to Windows Server 2012 R2 via Web Deploy on IIS.

Initially, I was using Visual Studio 2015 and publish only works if you add <AllowUntrustedCertificate>true</AllowUntrustedCertificate> and <UserName>domain\user.name</UserName> to the pubxml file. Migrating to Visual Studio 2017 CE caused the problem for me. See tldr section for answer.

I hope this helps others. Please comment to verify that this method works.