Could not establish secure channel for SSL/TLS with authority 'login.salesforce.com'

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Cloud Applications
Post Reply
brucecallen
Posts: 6
Joined: Tue 17 Feb 2015 20:31

Could not establish secure channel for SSL/TLS with authority 'login.salesforce.com'

Post by brucecallen » Tue 28 Jul 2015 14:50

I am getting an intermittent error
Could not establish secure channel for SSL/TLS with authority 'login.salesforce.com'
. I have a windows service which runs every 5 minutes and queries SalesForce. It works most of the time but more and more often I am getting the above error throughout the day.

Here is the stack trace:
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__6()
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation)
at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
Here is my connection string:
<add name="SalesForceConnection" connectionString="metadata=res://*/SalesForceDataModel.csdl&#xD;&#xA; |res://*/SalesForceDataModel.ssdl&#xD;&#xA; |res://*/SalesForceDataModel.msl;&#xD;&#xA; provider=Devart.Data.Salesforce;&#xD;&#xA; provider connection string="User Id=[email protected];Password=ssssss;Security Token=9999999999;Client Id=AFG.RemarketingService;Persist Security Info=True;Host=login.salesforce.com;Data Cache=1.db;Metadata Cache=1_metadata.db;"" providerName="System.Data.EntityClient"/>
Thank you
Bruce

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Could not establish secure channel for SSL/TLS with authority 'login.salesforce.com'

Post by Shalex » Wed 29 Jul 2015 06:52

Salesforce doesn't support SSL anymore: https://help.salesforce.com/apex/HTView ... uage=en_US. Please check your project (or environment settings) to find out a piece of code which switches application to using SSL3.

Try setting security protocol explicitly:

Code: Select all

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
JIC: refer to the discussion at http://stackoverflow.com/questions/2828 ... in-net-4-5.

Post Reply