Fix: Web deploy - could not verify the server’s certificate

Today when I tried to deploy my new ASP.NET CORE 2 app to SmarterASP.NET, the deployment failed with a message

Web deployment task failed. (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.

I got the publish profile from the SmarterASP.NET control panel and when I opened the PublishSettings using VS Code, it had AllowUntrustedCertificate="True" which I imported to the project but when I checked the Publish Profile under my project ( Project > Properties > xxx.pubxml), there was no entry of AllowUntrustedCertificate.

So, in order to fix the issue, inside PropertyGroup just added

 <AllowUntrustedCertificate>True</AllowUntrustedCertificate>

That solved the issue with web deploy.


comments powered by Disqus

About the author

  • Abhith Rajan

    Abhith Rajan

    Abhith Rajan is a full-stack developer, consultant, Sysberries employee, and biker. Who passionate about C# and JavaScript. Works on his blog, his personal finance web app and its react native mobile app in his free time.

    Buy me a coffeeBuy me a coffee