An error occurred in the secure channel support - Classic ASP HTTP Request
An error occurred in the secure channel support - Classic ASP HTTP Request
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:
Sub ShopXML4http(url,inStr, outStr, method,xmlerror) Dim objhttp Set objhttp = Server.CreateObject ("MSXML2.ServerXMLHTTP.6.0") objHttp.open method, url, false If Method="POST" Then objHttp.Send instr Else objHttp.Send End if outstr=objHttp.responseText Set objhttp=nothing End Sub
This code works fine almost all of the time (thousands of requests per day), but sporadically it will fail with a message like this:
Number: -2147012739
Description: An error occurred in the secure channel support
Source: msxml6.dll
The application was recently moved from an old Windows 2003 Server to the 2012 Server, and this issue never seemed to be a problem on the old server. In addition, while this error is happening on the website, I could run the exact same code in a VBScript and it works fine. Resetting the application pool seems to cause the site to be able to do the secure HTTP requests again (although it often fixes itself before I can get to the server).
Answer by Stephen Quan for An error occurred in the secure channel support - Classic ASP HTTP Request
Troubleshooting error codes:
- -2147012739 is a HRESULT.
- In hexadecimal that's 0x80072F7D.
- Look at the LOWORD: 0x2F7D.
- Convert that back to decimal: 12157.
- Lookup 12157 error codes.
- 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.
Answer by coderpros for An error occurred in the secure channel support - Classic ASP HTTP Request
I encountered this error a few months ago myself. Most often, this issue is caused by an invalid SSL cert. Considering that at the time of the post you had just migrated to a new server, you probably just need to reinstall the SSL certificate.
I realize this question is old, but hopefully someone else can benefit from my answer.
Answer by user3087157 for An error occurred in the secure channel support - Classic ASP HTTP Request
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.
Answer by Steve Neale for An error occurred in the secure channel support - Classic ASP HTTP Request
I've had the same issue and tried lots of solutions offered under a variety of posts but ultimately had no success, until now. I'll detail the solution that worked for me with reference to the problem as in my case it was Paypal. I've not opened a new post as this might not be just a paypal issue in future.
The solution is a combination of a number of stackoverflow posted solutions to similar problems but this seemed the best one to add to.
The problem: Trying to test Paypal IPN on windows 2008 Server using Classic ASP using the Paypal Sandbox returns the error "An Error Occurred in the Secure Channel Support"
Why it is a problem: Paypal are requiring all communications with their systems be as secure as possible. You will need a connection that is TLS 1.2. windows 2008 is not TLS 1.2 by default.
Paypal threw some confusion into the mix by saying you need a Verisign G5 certificate, which you do for the server root but not the domain you are running your code on. I also didn't install any paypal certificates as I don't use the api. I don't believe you need your comms from an https site either - although my domain is secured using a standard godaddy EV cert although I did a test on a non https site after and that worked too.
My solution: 1. First check what security your server is using via ssllabs (sorry as new user can't post more than 2 links so google ssllabs) It should be TLS1.2 or higher and no other TLS's or SSLs. It must also have a SHA256 encryption.
You may need to patch the server : https://support.microsoft.com/en-us/kb/3106991
Use IISCrypto to set the correct TLS and ciphers. I used the registry changes offered up elsewhere on stackoverflow but this did not work and actually totally screwed up my server for everything using https posts, not just my development site!. IISCrypto also handles the ciphers.
Make sure your application pool is v4.5, which in itself is unclear because IIS might only offer v4.0 as an option. However this is probably actually v4.5. You can verify this via https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx
Within your code you need to use Server.CreateObject ("MSXML2.XMLHTTP.6.0") not Server.CreateObject ("MSXML2.ServerXMLHTTP.6.0") as mentioned above.
Now I've no idea why the non-server XMLHTTP works as that seems contrary to the documentation behind it. Right now, after 10 days of stress, panic and frustration I don't care! I hope this is useful for others.
Finding the solution was a nightmare so I'll add some phrases below to help others if searching:
Paypal IPN failing with server error Paypal SSL windows 2008 errors An error occurred in the secure channel support classic ASP Paypal Sandbox SSL errors
I'd like to publicly thank Rackspace and GoDaddy for their help with this. I'd like to publicly state that I found paypal have the worst technical support ever and just do not care, constantly pointing to their own docs, if they ever respond. They say they've been sending emails out about this since September 2014 but I never received one. These new requirements are active on the paypal sandbox but go live in september 2016. I only came across it as developing a new solution so needed the sandbox - if you're running live you won't know about the problem until it hits and then you're dead in the water. Test your entire payment system on the paypal sandbox asap is my advice!!
Answer by Gruff for An error occurred in the secure channel support - Classic ASP HTTP Request
It's all valid however the 'critical' missing bit for TLS1.2 support on Windows 7 with IIS7.5 and classic asp is setting this in the registry:-
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp] "DefaultSecureProtocols"=dword:00000800
I hope that saves you a day of faffing, rebooting and head scratching! :)
This code snippet is useful for testing. https://www.howsmyssl.com/
<% Set winhttp = Server.CreateObject("WinHTTP.WinHTTPRequest.5.1") winhttp.open "GET", "https://howsmyssl.com/a/check", False winhttp.Send Response.Write winhttp.responseText %>
Answer by Tom Fahey for An error occurred in the secure channel support - Classic ASP HTTP Request
We had a variation on this issues and it really cost us some time to figure it out.
Here is the situation: An older Linux server hosting an application written in PHP and provides data through webservice calls. The server is using HTTPS. Calls from various clients are made with code using the winHTTP 5.2 library. (Winhttp.dll)
Symptom: Our clients are now getting sporadic error messages when making repeated winHTTP calls using a ?POST? command. The messages are either ?The buffers supplied to a function was to small.? or ?An error occurred in the secure channel support ?. After much searching we discovered that the client?s server was logging ?Schannel Event ID 36887 alert code 20? in the Event Viewer that corresponded with the visible error message.
Solution: We discovered that our old Linux server could not support TLS 1.2. (CentOS 5.11) We also learned that several of our clients had recently (summer 2016) applied an update to their Microsoft servers. (Server 2008, server 2012) The fix was to force their servers to use TLS 1.1 for the webservice calls. The part that is rather strange to me is that the settings in Internet Explorer for changing the TLS had no effect on the problem. However by changing a setting in Group Policies we were able to solve the problem. Our technical advisor on this matter pointed out that the change is really obscure, but that a third-party vendor has provided a quick solution. That tool is called IIS Crypto from Nartac. https://www.nartac.com/Products/IISCrypto/Download The tool lets you specifically select Protocols. We are now getting a new server to host our applications (CentOS 6) and then should be able to use the TLS 1.2 protocol!
Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72
0 comments:
Post a Comment