cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Sybase SQL Anywhere 16.0 Web Client Function fails with "The secure connection to the remote host failed: The connection was closed from the other side"

0 Kudos
3,340

Hi,

Attempting HTTP:POST web service call from a database function. It fails with

"The secure connection to the remote host failed: The connection was
closed from the other side
SQLCODE=-990, ODBC 3 State=HY000" 
The function id defined as follows:

ALTER FUNCTION "custom"."CurbSide"( in "JsonLoad" long varchar,
in "certificate1stav" long varchar ) 
returns long varchar
url 'https://xxx.yyy.com/OrderStatus'
type 'HTTP:POST:application/json'
certificate '!certificate1stav'
set 'REDIR (COUNT = 0)'
SET 'HTTP (VERSION=1.1 )'
VolkerBarth
Contributor
0 Kudos

Have you tried web client logging (via dbsrv16 -zoc or via sa_server_option('WebClientLogging', 'ON') to get more info?

And is this a new error returned by a previously working web client function or is this within new development?

0 Kudos

Hi This is a new dev so was not previously working the log shows:

[connid = 4, 06/05 10:58:17.745]
[connid = 4, 06/05 10:58:17.745, REQUEST]
POST /OrderStatus HTTP/1.1
Content-Type: application/json; charset=windows-1252
Connection: close
Date: Fri, 05 Jun 2020 08:58:17 GMT
ASA-Id: 32eaa7657380440aa9117be562d56070
User-Agent: SQLAnywhere/16.0.0.1761
Host: xxx.yyy.com
Accept-Charset: windows-1252, UTF-8, *
Content-Length: 170

[connid = 4, Error: socket closed]
[connid = 4, socket closed]
VolkerBarth
Contributor
0 Kudos

I would try whether a different client (say, SoapUI or the OpenSSL client) can connect to that web server with the according request or returns more error information. You might also try with SQL Anywhere 17.

Vlad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Can you test the HTTP version of the API? Maybe the issue occurs, because your DB doesn’t trust the SSL certificate? Or the certificate is old...

VolkerBarth
Contributor
0 Kudos

And as you are using the very old 16.0.0.1761 build for new development, I would recommend to use the latest v16 EBF at least (16.0.0.2798) (or v17).

Accepted Solutions (0)

Answers (0)