How to Fix Could Not Verify Server Certificate WebDeploy

We have observed that few of our clients and many users experience this error when publishing core from Visual Studio 2019. So, we will write solution about how to fix this error message. The following is the error message:


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.

To solve this, we need some option to allow untrusted certificates in publishing settings.


Currently, there are not any options available to allow untrusted certificates so we need to do some tweaks which are as below:

  • Please search for Publish profile file within  /Properties/PublishProfiles folders and open it
  • set AllowUntrustedCertificate to True (<AllowUntrustedCertificate>True</AllowUntrustedCertificate>) inside the <PropertyGroup> element
  • Add below lines in the same file if tags are not available

That is it. It should not throw the exception now.

Hope it helps.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *