2012 R2 .net core http/2

光 陈 1 Reputation point
2021-03-11T13:05:27.807+00:00

System.Net.Sockets.SocketException No connection could be made because the target machine actively refused it. System.Net.Http.HttpRequestException No connection could be made because the target machine actively refused it. System.AggregateException One or more errors occurred. (No connection could be made because the target machine actively refused it.) 在windows 2012 中使用HttpClient 调用apple APNs http/2 api 出现异常,求高手帮助 (The SSL connection could not be established, see inner exception.

Developer technologies ASP.NET ASP.NET Core
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 60,161 Reputation points
    2021-03-11T15:12:19.667+00:00

    This is a standard SSL issue. You are unable to connect to the remote machine. Unfortunately you provide no information on what you were doing, any code involved, whether this was client or server side, what SSL protocols you were using, etc so we aren't going to be much help at this point.

    Note the following:

    1. HTTP/2 is not supported on Server 2012 R2. The earliest supported server is 2016 and Windows 10. However there are many clients that don't support HTTP/2 either so at this time web servers generally support HTTP and HTTP/2 to handle either protocol.
    2. TLS 1.2+ is the only recommended protocols for HTTPS. This protocol must be enabled on the client and server in order for them to communicate. The error you're giving tends to indicate that the client and server are not agreeing on this. Refer to the IIScrypto tool for information on how to enable on the server.
    3. You mention .NET Core so that will support TLS 1.2 automatically but older clients like .NET Framework 4.6 apps have to opt into the newer protocol. There is an entire article in MSDN on how to do this.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.