Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides
New in version: 5.4   6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2    Statistic  

CURL.SetOptionCAINFO

Sets a path to find certificate file.

Component: CURL
Version: 2.5
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: Yes

MBS( "CURL.SetOptionCAINFO"; Handle; Value { ; Encoding } )

Parameters

Parameter Description Example value
Handle The CURL session handle. $curl
Value The file path for the certificates. "/test.pem"
Encoding Optional
The text encoding for text parameter.
Default is UTF-8.
Possible encoding names: ANSI, Arabic-Mac, Arabic-Win, Baltic-Win, CentralEurope-Mac, ChineseSimp-Mac, ChineseSimp-Win, ChineseTrad-Mac, ChineseTrad-Win, Cyrillic-Mac, Cyrillic-Win, EasternEurope-Win, Greek-Mac, Greek-Win, Hebrew-Mac, Hebrew-Win, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-15, Korean-Johab, Korean-Mac, Korean-Win, Latin1, Mac, Native, ShiftJIS-Mac, ShiftJIS-Win, Turkish-Mac, Turkish-Win, UTF-8, DOS or Windows. Pass native to use the native encoding of the current platform.
"UTF8"

Result

Returns "OK" on success.

Description

Sets a path to find certificate file.
Pass a string naming a file holding one or more certificates to verify the peer with. This makes sense only when used in combination with the CURL.SetOptionVerifyPeer option. If CURL.SetOptionVerifyPeer is zero, CURL.SetOptionCAINFO need not even indicate an accessible file.

This option is by default set to the system path where libcurl's cacert bundle is assumed to be stored, as established at build time.

When built against NSS, this is the directory that the NSS certificate database resides in.

see also
http://www.mbsplugins.de/archive/2013-01-31/SSL_Security_with_CURL/monkeybreadsoftware_blog_archive

Examples

Enables verification and uses cacert.pem file for certificates:

MBS( "CURL.SetOptionCAINFO"; $curl; $cacertPath )
MBS( "CURL.SetOptionSSLVerifyHost"; $curl; 2 )
MBS( "CURL.SetOptionSSLVerifyPeer"; $curl; 1 )

See also


CURL.SetOptionBufferSize   -   CURL.SetOptionCAPATH

Feedback: Report problem or ask question.




Links
MBS Realbasic Plugins - Jugendzentrum Nickenich