How to Fix Web Deploy Errors by Allowing Untrusted SSL Certificates in Visual Studio


When deploying .NET applications or ASP.NET web sites to a server via Visual Studio Web Deploy, you may encounter deployment failures caused by untrusted or self-signed SSL/TLS certificates on the destination server.

If your server uses a self-signed certificate or an internal SSL configuration for management ports, Visual Studio will block the deployment connection by default to prevent potential security risks.

You can resolve this issue by configuring Visual Studio to accept untrusted certificates during the deployment process.

Method 1: Enable Untrusted Certificates via Visual Studio GUI

If you manage your deployment settings through Visual Studio’s user interface, follow these steps:

  1. Open Your Project: Launch Visual Studio and open the project solution you wish to deploy.

  2. Access Publish Settings: Select the Publish tab for your project and locate your active publish profile configuration.

  3. Edit Settings: Click on Configure (or Settings depending on your Visual Studio version) to open the profile settings dialog.

  4. Modify Connection Rules: Navigate to the Settings or Advanced section within the configuration menu.

  5. Enable the Setting: Locate and check the box labeled "Allow untrusted certificate".

  6. Save & Deploy: Save your settings and attempt to publish your project again.

Method 2: Configure the .pubxml File Directly (Advanced)

If you prefer editing configuration files directly, or if you are managing deployment profiles in a source-controlled repository, you can update the .pubxml file manually.

  1. Locate the Profile File: In Visual Studio’s Solution Explorer, navigate to:

    Plaintext
     
    Properties/PublishProfiles/
    
  2. Open the File: Open the .pubxml file corresponding to your deployment environment (e.g., Production.pubxml or Staging.pubxml).

  3. Add the Configuration Tag: Inside the primary <PropertyGroup> block, insert the <AllowUntrustedCertificate> tag and set its value to True:

XML
 
<PropertyGroup>
  <AllowUntrustedCertificate>True</AllowUntrustedCertificate>
</PropertyGroup>
  1. Save the File: Save your changes and re-run your publish profile.

Best Practices & Security Note

  • Testing & Staging Environments: Enabling <AllowUntrustedCertificate>True</AllowUntrustedCertificate> is ideal for local development, staging, or internal web servers where temporary or self-signed SSL certificates are used.

  • Production Environments: For live production servers, it is strongly recommended to secure your Web Deploy endpoint with a valid, trusted SSL/TLS certificate (such as a free Let's Encrypt certificate) rather than bypassing certificate validation permanently.

Need Further Assistance?

If you continue to experience deployment failures or routing issues when publishing to your server environment, reach out to our local Australian technical support team. Log into your dashboard to open a ticket directly with our engineering team.


Was this answer helpful?

Still need help?

Our friendly support team are ready to offer assistance with any issues you may be encountering.
Click the button below to open a ticket:
Open Ticket

 WordPress Hosting

Fast hosting for WordPress
Experience the best in Australian WordPress hosting with lightning fast servers, built-in caching, and performance tools.

 Build Your Website

Sitejet Hosting
Build your site fast with a drag and drop editor with no coding required. 140+ quality, templates to get you started.

 Register Domains

It all starts with your domain name
Find the perfect domain and register now with our competitive pricing on all extensions.

 Web Hosting

Fast, local, secure hosting
Full featured hosting on cPanel with multiple server locations around the country.
« Back