Solved

http connector status code -1


Userlevel 2
Badge +2
I am trying to use the http-connector to connect to a website/webshop (http://webshop.coffeefresh.nl). The http connector is returning error code -1. When I do the same request to http://bol.com for instance I receive status code 0 / http 200 OK.

I can reach the URL without any problems using a browser or insomnia. Just not with the http connector.

What can be the cause of the -1 error code, or, where do I look for the problem?
icon

Best answer by Vincent Doppenberg 18 June 2019, 16:45

Hi Hugo,

The problem is most likely that your GUI is quite old. That version of the GUI still targets version 4.5 of the .NET Framework, which means that it will have the problem that I described earlier. Updating your GUI to the newest version, which targets .NET Framework 4.7, should fix this issue.
View original

11 replies

Userlevel 4
Badge +1
Hi Hugo,

Could you try this process flow in a Windows GUI running in developer mode and check if there are any error messages in the Debug window?

Almost all scenarios in which an HTTP-connector returns the status code -1 will cause an error message with more details to be written to the Debug window.
Userlevel 2
Badge +2
The message in the Debug window:

The underlying connection was closed: An unexpected error occurred on a send.

Again, this does not happen with other websites. (http:\\coffeefresh.nl is ok, http:\\webshop.coffeefresh.nl gives an error).
Userlevel 4
Badge +1
Hi Hugo,

A common reason for this error is that the server rejects the request because the client is unable to comply with the security specifications of the SSL/TLS certificate on the server. I have checked the certificates for both domains, and indeed, the webshop.coffeefresh.nl domain is stricter and will reject TLS 1.0 connections, whereas the coffeefresh.nl domain will not.

This problem should only occur if you are using an older version of the .NET Framework (i.e. older than 4.6). Can you confirm that you are using an older version of the .NET Framework? Updating to 4.6 or higher should resolve this.
Userlevel 4
Badge +1
Hi Hugo,

Could you provide an update with regard to the status of this issue?
Userlevel 2
Badge +2
Hi Vincent,

I dropped the question at our system administrators, I did not receive a full answer yet. I will post an update here as soon as I know anything.
We solved the original question, sending an action URL to the webshop, by using the following code, where @URL is the action URL:

code:
EXEC sp_OACreate 'WinHttp.WinHttpRequest.5.1', @pointer OUTPUT
EXEC sp_OAMethod @pointer, 'open',NULL, 'GET', @URL,0
EXEC sp_OAMethod @pointer, 'send'
EXEC sp_OAMethod @pointer, 'Status', @status OUTPUT
EXEC sp_OAMethod @pointer, 'StatusText', @status_text OUTPUT
EXEC sp_OAMethod @pointer, 'responseText', @response_text OUTPUT
EXEC sp_OADestroy @pointer
Userlevel 2
Badge +2
We currently have the following version of the .net framework on our servers: 4.7.03062.
Userlevel 4
Badge +1
Hi Hugo,

Could you tell me which GUI version are you using? And can you also attach a screenshot of the input parameters of your HTTP connector?
Userlevel 2
Badge +2
Vincent,

GUI version 2018.2.18.0


Userlevel 4
Badge +1
Hi Hugo,

The problem is most likely that your GUI is quite old. That version of the GUI still targets version 4.5 of the .NET Framework, which means that it will have the problem that I described earlier. Updating your GUI to the newest version, which targets .NET Framework 4.7, should fix this issue.
Userlevel 2
Badge +2
Vincent,

Thank you for your answer. I have a newer version of the GUI in test, I will try that.
Userlevel 2
Badge +2
Update: the new GUI fixed the problem. Thnx again 🙂.

Reply