BizTalk Server WCF-SQL: The certificate chain was issued by an authority that is not trusted.

Today, while trying to generate a new WCF-SQL Schema from Visual Studio, we got the following error:

Connecting to the LOB system has failed. 
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 – The certificate chain was issued by an authority that is not trusted.).


That error occurred because we had previously tried to generate an SQL schema connecting to an Azure SQL Database, and for that, we needed to set the Encrypt property to true.

  • Encrypt property specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client. The default value is false.

Why am I referring to this? The Consume Adapter Service wizard tool caches the settings that you have set up on the previous execution, except if this is the first time you have executed the tool since you opened the Visual Studio Project. That means:

  • When you open the Visual Studio project, the first time you execute the Consume Adapter Service wizard tool, it has the default settings.
  • While staying with that Visual Studio instance open. In previous runs of the tool, you see the previous settings configurations, except for the passwords.
  • If you close Visual Studio, those settings are “clean”.

In our case, we were trying to connect to a local database, which doesn’t use certificates, so the Encrypt setting needs to be turned off.


The solution to this problem is quite simple but not easy to understand, given the error information and the Visual Studio behavior of caching settings.

  • On the Consume Adapter Service wizard tool, click on Configure.
  • On the Configure Adapter window, click on the Binding Properties tab and set the Excrypt property to False.

After that, we were, once again, able to successfully connect to SQL Server.

Hope you find this helpful! So, if you liked the content or found it useful and want to help me write more, you can buy (or help me buy) my son a Star Wars Lego! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

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


Back to Top