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:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Sets a path to find certificate file.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
CURL | 2.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
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 |
Returns "OK" on success.
See also CAINFO option in CURL manual.
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
Created 18th August 2014, last changed 26th May 2021