0

We are discontinuing use of TLS 1.0 on our servers. This seems to have caused problems communicating with the Carto APIs. (The problem has become apparent when accessing the SQL API, but I wouldn't be surprised if the same problem is apparent with the other APIs, once we get past this exception.)

This exception is thrown when calling the SQL API:

User:[Unknown]; Message:System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.ComponentModel.Win32Exception: The client and server cannot communicate, because they do not possess a common algorithm    
System.Net.SSPIWrapper.AcquireCredentialsHandle(SSPIInterface SecModule, String package, CredentialUse intent, SecureCredential scc)    
System.Net.Security.SecureChannel.AcquireCredentialsHandle(CredentialUse credUsage, SecureCredential& secureCredential)    
System.Net.Security.SecureChannel.AcquireClientCredentials(Byte[]& thumbPrint)    
System.Net.Security.SecureChannel.GenerateToken(Byte[] input, Int32 offset, Int32 count, Byte[]& output)    
System.Net.Security.SecureChannel.NextMessage(Byte[] incoming, Int32 offset, Int32 count)    
System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)    
System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)    
System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)    
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)    
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)    
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)    
System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)    
System.Net.TlsStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback asyncCallback, Object asyncState)    
System.Net.ConnectStream.WriteHeaders(Boolean async)     --- End of inner exception stack trace ---    
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)    
System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)     --- End of inner exception stack trace ---    
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    
{error in our code}

Is TLS 1.0 a known requirement, and if so, is there any workaround?

0

The solution turned out to be pretty simple. The code which makes the API call is written in .NET 4.5, and by default it disables outbound communication using TLS1.1 and TLS1.2 (no idea why). It's a simple matter to enable those protocols though, as shown in this post.

ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.