cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Anywhere 17.0.10.6057: The secure connection to the remote host failed: The connection was closed from the other side

0 Kudos
2,602

I have web-function that works perfectly in SQL Anywhere 16.0.0.2546:


create function "fa_get_info"( 
  in "urlSpec" long varchar,
  in "headerSpec" long varchar,
  in "certificate1stav" long varchar ) 
returns long varchar
url '!urlSpec'
type 'HTTP:POST:application/json'
certificate '!certificate1stav'
set 'REDIR (COUNT = 0)'
header '!headerSpec'
In SQL Anywhere 17.0.10.6057, I sometimes get a response from this function, and sometimes an exception.
"-zoc"-log does not contain an error.
The function uses the same certificate.

OK: BODY={"success":true,"username":"...}


[connid = 1, [10/04/2020:16:44:29.036 0300], REQUEST]
POST /login/ajaxSuccess HTTP/1.0
Date: Fri, 10 Apr 2020 13:44:29 GMT
Connection: close
Content-Type: application/json; charset=windows-1251
ASA-Id: ...
COOKIE: JSESSIONID=...
Content-Length: 0
Host: d4wnew.1stAvailable.com.au
User-Agent: SQLAnywhere
Accept-Charset: windows-1251, UTF-8, *

[connid = 1, [10/04/2020:16:44:29.896 0300], RESPONSE] HTTP/1.1 200 OK 1st_backend: prod_app22 Access-Control-Allow-Credentials: true Access-Control-Allow-Headers: x-prototype-version,x-requested-with Access-Control-Allow-Methods: GET,POST,OPTIONS Access-Control-Allow-Origin: * Content-Security-Policy-Report-Only: ... Content-Type: application/json;charset=UTF-8 Date: Fri, 10 Apr 2020 13:44:27 GMT p3p: CP="CAO PSA OUR" Server: Apache-Coyote/1.1 Strict-Transport-Security: max-age=31536000 Content-Length: 143 Connection: Close

{"success":true,"username":"...} [connid = 1, socket closed]

EXCEPTION: -990, WW059, The secure connection to the remote host failed: The connection was closed from the other side

[connid = 1, [10/04/2020:16:54:38.782 0300], REQUEST]
POST /appointmentBook/list/2102?format=json&all=true HTTP/1.0
User-Agent: SQLAnywhere
Content-Length: 0
Date: Fri, 10 Apr 2020 13:54:38 GMT
Host: d4wnew.1stAvailable.com.au
ASA-Id: ...
X-Requested-With: XMLHttpRequest
Connection: close
Accept-Charset: windows-1251, UTF-8, *
COOKIE: JSESSIONID=...
Content-Type: application/json; charset=windows-1251

[connid = 1, [10/04/2020:16:54:39.725 0300], RESPONSE] HTTP/1.1 200 OK 1st_backend: prod_app22 Access-Control-Allow-Credentials: true Access-Control-Allow-Headers: x-prototype-version,x-requested-with Access-Control-Allow-Methods: GET,POST,OPTIONS Access-Control-Allow-Origin: * Content-Security-Policy-Report-Only: ... Content-Type: application/json;charset=UTF-8 Date: Fri, 10 Apr 2020 13:54:36 GMT p3p: CP="CAO PSA OUR" Server: Apache-Coyote/1.1 Strict-Transport-Security: max-age=31536000 Connection: Close

[{"id":5228,"subscriberName":"Dr ...}] [connid = 1, socket closed]

Why so? Bug or ... ?

Accepted Solutions (1)

Accepted Solutions (1)

The problem was "cured" by adding

set 'HTTP(VERSION=1.1)'
like 2817347 - Remote web call, connection failed

VolkerBarth
Contributor
0 Kudos

Just to add the resume from that (not publically available) information:

Symptom

The secure connection to the remote host failed: The connection was closed from the other side

Cause

If you do not specify the HTTP version and CHUNK is set to OFF, HTTP version 1.0 is used, which will fail if the server requires HTTP 1.1.

Answers (0)