M.Azad
M.Azad

Reputation: 3763

How can resolve Untrusted certificates Error ?( TFS2013 Build and deploy to IIS )

I crate a build definition on tfs2013.when I queue my builddefinition I get an error about Untrusted certificates.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets (4270): Web deployment task failed. (Connected to the remote computer ("developertest") 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. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED.

I check help link and it has 3 way to resolve it

For first and third way I dont know how do it In second way I cant find Allow untrusted in vs2013 publish dialog

Upvotes: 3

Views: 4223

Answers (3)

user16570261
user16570261

Reputation: 1

Publish to a server using an untrusted certificate

Add the <AllowUntrustedCertificate> property with a value of True to the publish profile: C:\Users\xxxx\source\repos\xxxx\xxxx\Properties\PublishProfiles\IISProfile.pubxml
    <PropertyGroup>
      <AllowUntrustedCertificate>True</AllowUntrustedCertificate>
    </PropertyGroup>

https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/visual-studio-publish-profiles?view=aspnetcore-5.0#publish-to-a-server-using-an-untrusted-certificate

Upvotes: 0

Zia Ul Murtaza
Zia Ul Murtaza

Reputation: 29

Thanks M.Azad, It resolved my problem. I was trying to set these configurations in .pubxml file True False but that was not resolving the issue, but adding /p:AllowUntrustedCertificate=true arugment in msbuild.bat file resolved.

Complete argument list to msbuild.exe

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe %ProjectPath% /fl /flp:logfile=%LogPath% /T:Build /p:DeployOnBuild=true /p:DeployTarget=MSDeployPublish /p:PublishProfile=%ProfilePath% /p:PublishDir="C:\wwroot" /p:AllowUntrustedCertificate=true /p:VisualStudioVersion=12.0

Upvotes: 2

M.Azad
M.Azad

Reputation: 3763

I add /p:AllowUntrustedCertificate=true to MsBuild arguments.and it's resolved

Upvotes: 9

Related Questions