简体   繁体   中英

Server Certificate Error on publish, .Net core 5.0, IIS server

I am trying to publish my .net core 5.0 application to our IIS Server. Every time I do I keep getting the following error:

Severity Code Description Project File Line Suppression State Error Web deployment task failed. (Connected to the remote computer ("myServer") 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: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED. )

I found this post over the same issue. No matter what configuration I use in my publish profile though it does not seem to work. I am a bit confused that the publish profile I imported does not contain PropertyGroup information or anything like that. Just the publishProfile tag with relevant information.

PublishSettings:

Here are my publish settings. What do I need to add in order to get my publishing of the app to ignore the server cert? Again I just want to say I tried adding the AllowUntrustedCertificate and multitude of other suggestions from that other post. Is that setting supposed to go inside the publishProfile information or just right after it within the PublishData? Either way nothing I do works.

<?xml version="1.0" encoding="utf-8"?>
<publishData>
  <publishProfile
    publishUrl="https://MYSERVER:8172/msdeploy.axd"
    msdeploySite="ToolController"
    destinationAppUrl="http://myWebSite"
    mySQLDBConnectionString=""
    SQLServerDBConnectionString=""
    profileName="Default Settings"
    publishMethod="MSDeploy"
    userName="myUserName" />
</publishData>

I am also using Visual Studio 2019 in case that helps at all.

Okay so I am not sure why but using the normal method I typically do. By going to the IIS server -> right clicking the site -> Deploy -> Configure Web Deploy Publishing was not working at all.

Instead I opted to use the visual studio option of generating the publish file by doing Web Server (IIS) -> filling in the relevant info. I then added the

<AllowUntrustedCertificate>True</AllowUntrustedCertificate>

and everything worked fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM