2
votes

I need to enable outbound request from windows server 2012 R2 from .net application (build in 4.0 version).

I've followed everything as stated in this link But still I'm receiving the following error:

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 at System.Net.SSPIWrapper.AcquireCredentialsHandle(SSPIInterface SecModule, String package, CredentialUse intent, SecureCredential scc) at System.Net.Security.SecureChannel.AcquireCredentialsHandle(CredentialUse credUsage, SecureCredential& secureCredential) at System.Net.Security.SecureChannel.AcquireClientCredentials(Byte[]& thumbPrint) at System.Net.Security.SecureChannel.GenerateToken(Byte[] input, Int32 offset, Int32 count, Byte[]& output) at System.Net.Security.SecureChannel.NextMessage(Byte[] incoming, Int32 offset, Int32 count) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.TlsStream.CallProcessAuthentication(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.ConnectStream.WriteHeaders(Boolean async) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetResponse()

I'm facing this error because we are using checkout payment gateway and they stopped taking any request below TLS 1.2 after that we are facing this issue.

Here is part of my registry key sample:

enter image description here

Please suggest me on how may I solve this issue. Thanks in advance.

2
The error may be on the local PC. Open you IE and in advance settings see if TLS is enabled.jdweng
this is not in my local pc error.user7336033
If the request did not have TLS enabled it could give the error : The client and server cannot communicate, because they do not possess a common algorithmjdweng
There's not enough information in your question. Do you have code that throws an exception? Why haven't you provided it in the question? Right now, because of deficiencies in this question, you are receiving speculative answers that attract downvotes and are of no use to you or anyone else because your problem is not properly described. Show your code. Write a question that makes sense without having to follow links to another site.spender

2 Answers

-2
votes

You should explicitly choose TLS 1.2 in code. Add the following row on the start of your application:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
-2
votes

TLS is Security Layer That You can enable it in iis with import an certificate in the server certificates. certificate file is a file with .pfx extension that you can create it with a lot of way