An error occurred in the secure channel support - Classic ASP HTTP Request

后端 未结 8 1493
悲&欢浪女
悲&欢浪女 2020-12-29 03:02

I have a classic ASP website running on a Windows Server 2012 box. One page makes a HTTP request to another application over https using code like this:



        
相关标签:
8条回答
  • 2020-12-29 03:33

    I have had the exact same problem after migrating from 2003 to 2008 R2 and found the solution. Change:

    Set objhttp = Server.CreateObject ("MSXML2.ServerXMLHTTP.6.0")

    to:

    Set objhttp = Server.CreateObject ("MSXML2.XMLHTTP.6.0")

    and your problem will go away.

    I tried to find the pros and cons about both objects, but haven't yet found a reason to not use XMLHTTP.

    0 讨论(0)
  • 2020-12-29 03:37

    Troubleshooting error codes:

    1. -2147012739 is a HRESULT.
    2. In hexadecimal that's 0x80072F7D.
    3. Look at the LOWORD: 0x2F7D.
    4. Convert that back to decimal: 12157.
    5. Lookup 12157 error codes.
    6. Find that it matches: ERROR_WINHTTP_SECURE_CHANNEL_ERROR

    A bit of Google-fu finds http://msdn.microsoft.com/en-us/library/windows/desktop/aa383770(v=vs.85).aspx which states:

    ERROR_WINHTTP_SECURE_CHANNEL_ERROR

    12157

    Indicates that an error occurred having to do with a secure channel (equivalent to error codes that begin with "SEC_E_" and "SEC_I_" listed in the "winerror.h" header file).

    However, you already discovered this as the message you got was "Description: An error occurred in the secure channel support". So this leads us right back where we started.

    The other observation I make is that your code is a non-asynchronous WinHTTP request (I know it has to be to function inside ASP), but, the concern is, due to the high frequency, your machine could be processing more than one WinHTTP request concurrently. I've seen some Windows deliberately throttle the total number of active concurrent WinHTTP request by blocking the late requests. For example, on a Windows 7 machine a process cannot make more than 2 concurrent requests to the same remote server. i.e. The 3rd, 4th... requests will be blocked until the first two complete.

    One solution is to load balance incoming request over more than one application pool or over more servers.

    0 讨论(0)
提交回复
热议问题