cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Calling an external web service via https using the system certificate store

Stalker4
Explorer
0 Likes
1,123

Hi,

SAP SQL Anywhere 17.0.10.5866 for WIndows

There is an external web service
Url: https://MyService.com/token
Request method: POST
Content-Type: x-www-form-urlencoded

Created a web procedure to call it:

CREATE PROCEDURE "dba"."TestAccessToken2"( in "client_id" long varchar,in "client_secret" long varchar,in "grant_type" long varchar ) 
result( "cAttribute" long varchar,"cValue" long varchar,"npp" integer ) 
url 'https://MyService.com/token'
set 'HTTP(VERSION=1.1)'
type 'HTTP:POST'
CERTIFICATE 'file=*'

Please note that in the body of this procedure, I specified “CERTIFICATE ‘file=*’”, which means that I want SQL Anywhere to use a certificate from the operating system's certificate store when calling an external web service via https.

 Example of calling this web procedure:

select * from dba.TestAccessToken2('Myclient' ,'MySecret', 'credentials')

When executing this code (calling the web procedure), I get an error message:

The secure connection to the remote host failed: The TLS handshake
failed, error code 0x20001040

Question: Am I calling this external web service correctly ?
Why is the error occurring—did I specify something incorrectly, or is the required certificate missing from the system store ?

 

Accepted Solutions (0)

Answers (0)