cancel
Showing results for 
Search instead for 
Did you mean: 

stored procedure certificate clause

Former Member
1,926

Hi,

I created a few in the past, but now i MUST use httpS. i really do not know what to fill in in the certificate clause.

From the browse it works, but from a stored proc/function it does not. Below the error.


There was an error reading the results of the SQL statement. The displayed results may be incorrect or incomplete. The secure connection to the remote host failed: A certificate file must be specified SQLCODE=-990, ODBC 3 State="HY000"

Create FUNCTION "USR"."Post_list"( in XMLdata long varchar ) returns long varchar url 'https://test.nl/interchange' //clientport '443'
type 'HTTP:POST:text/xml' certificate

regards,

marc

Accepted Solutions (0)

Answers (1)

Answers (1)

VolkerBarth
Contributor

You will need to use the CERTIFICATE clause, such as

certificate 'file=C:\\MyCertStore\\MyRootCA.crt'

and by that specify a file or a string containing the certificate - or with v17 the certificate store.

See that FAQ on what certificate you need.

Former Member
0 Kudos

Thanks for your input. I am using sqlanywhere 12.0.1.4403

I am working on the certificate clause, but i'm afraid i get lost there. Should i export a certificate and convert it to crt format, and how do i know which one? Or can i use the other keys, apart from the file, and from which certificate do i need which properties?

We are trying to buy upgrade licence for version 17, but until then i must use 12.

This is from the 12 Docs:

The necessary information is specified in a string of semicolon-separated key/value pairs. You can use the file key to specify the file name of the certificate, or you can use the certificate key to specify the server certificate in a string. You cannot specify a file and certificate key together. The following keys are available: file The file name of the certificate. certificate cert The certificate itself. company co The company specified in the certificate. unit The company unit specified in the certificate. name The common name specified in the certificate.

Regards,

Marc

VolkerBarth
Contributor
0 Kudos

See the cited FAQ: You will need to provide the root certificate of the web server's certificate. Just visit the site with your browser and check what web server certificate it uses, and store that with the complete certificate chain, then use the whole cert file or just the root certificate.

Former Member
0 Kudos

No I assume I need to export this and save it on the machine running the DB I call my Stored Proc.

Is there a tool / manual for doing this the proper way. I get a parsing error all the time. Guess i miss something...

Regards,

Marc

VolkerBarth
Contributor
0 Kudos

FWIW, here's a sample which includes how to download a web server certificate from a web site and store it as a .crt-file:

Sending Email From SQL Anywhere 12 Via Google's SMTP Server

While this blog article deals with using a certificate for SMTP, the handling is similar to including that for a HTTPS web client procedure. In a web client procedure, you would here simply add a clause like

...certificate 'file=c:\\\\temp\\\\Equifax_Secure_Certificate_Authority.cer'