Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
CURL.SetOptionCAINFO
Sets a path to find certificate file.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| CURL | 2.5 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| curl | The CURL session handle. | $curl | |
| Value | The file path for the certificates. | "/test.pem" | |
| Encoding | The text encoding for text parameter. Default is UTF-8. Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ. |
"UTF8" | Optional |
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
Starting with version 8.0 the plugin will always use UTF-8 encoding for file path on Linux and macOS. For macOS we also do the unicode character normalization for file names for you.
See also CAINFO option in CURL manual.
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 )
Use FileMaker's root file in CURL:
Set Variable [ $curl ; Value: MBS("CURL.New") ]
#
If [ MBS("IsIOS") ]
# look for path to certificate file
Set Variable [ $path ; Value: Substitute(MBS("Folders.UserDocuments"); "/Documents"; "/Library/Application Support/FileMaker/iOS/1.0/root.pem") ]
If [ MBS("Files.FileExists"; $path) ]
# use in CURL
Set Variable [ $r ; Value: MBS( "CURL.SetOptionCAINFO"; $curl; $path) ]
Else
Show Custom Dialog [ "File not found." ; $path ]
End If
Else If [ MBS("IsMacOSX") ]
# look for path to certificate file
Set Variable [ $path ; Value: Substitute(MBS("Folders.UserDocuments"); "/Documents"; "/Library/Application Support/FileMaker/Shared/17.0/root.pem") ]
If [ MBS("Files.FileExists"; $path) ]
# use in CURL
Set Variable [ $r ; Value: MBS( "CURL.SetOptionCAINFO"; $curl; $path) ]
Else
Show Custom Dialog [ "File not found." ; $path ]
End If
Else If [ MBS("IsWindows") ]
# look for path to certificate file
Set Variable [ $path ; Value: Substitute(MBS("Folders.UserDocuments"); "\Documents"; "\AppData\Local\FileMaker\FileMaker Pro Advanced\17.0\root.pem") ]
If [ MBS("Files.FileExists"; $path) ]
# use in CURL
Set Variable [ $r ; Value: MBS( "CURL.SetOptionCAINFO"; $curl; $path) ]
Else
Show Custom Dialog [ "File not found." ; $path ]
End If
Else If [ MBS("IsLinux") ]
# look for path to certificate file
Set Variable [ $path ; Value: "/FileMakerData/Extensions/OpenSSL/root.pem" ]
# use in CURL
Set Variable [ $r ; Value: MBS( "CURL.SetOptionCAINFO"; $curl; $path) ]
End If
See also
- CURL.New
- CURL.SetOptionCookie
- CURL.SetOptionSSLCert
- CURL.SetOptionSSLKey
- CURL.SetOptionSSLVerifyHost
- CURL.SetOptionSSLVerifyPeer
- Folders.UserDocuments
- IsIOS
- IsLinux
- IsWindows
Example Databases
Blog Entries
- Using Apple's Global Service Exchange web service in FileMaker
- Use root certificates included with FileMaker
- Upload email to Sent folder via IMAP
- MBS FileMaker Plugin, version 7.6pr3
- Using Apple's Global Service Exchange web service in FileMaker
- Sending emails in FileMaker with MBS Plugin
- Sending Email with FileMaker via MBS Plugin
FileMaker Magazin
Release notes
- Version 8.0
- Changed CURL.SetOptionCAINFO, CURL.SetOptionCAPATH, CURL.SetOptionCookieFile, CURL.SetOptionCookieJar, CURL.SetOptionIssuerCert, CURL.SetOptionNETRCFile, CURL.SetOptionRandomFile, CURL.SetOptionSSHPrivateKeyfile, CURL.SetOptionSSHPublicKeyfile, CURL.SetOptionSSLCert, CURL.SetOptionSSLKey to use always UTF-8 on Mac/Linux and on Mac do the unicode transformation for decomposed characters to avoid trouble with special characters in file paths.
Created 18th August 2014, last changed 12nd March 2020
CURL.SetOptionBufferSize - CURL.SetOptionCAPATH
Feedback: Report problem or ask question.
Links
MBS Xojo Plugins