CURL.SetOptionCAPath
--------------------

Sets the certificate directory.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [2.5](newinversion25.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.SetOptionCAPath"; curl; Value { ; Encoding } ) 

**MBS**( **"CURL.SetOptionCAPath";** /\* Sets the certificate directory. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**; /\* The path to certificates directory.e.g. "/data/MyCertificates" \*/   
**$Encoding**) /\* Optional; The text encoding for text parameter.   
Default is UTF-8.e.g. "utf8" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| curl | The CURL session handle. | $curl |  |
| Value | The path to certificates directory. | "/data/MyCertificates" |  |
| 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](https://www.monkeybreadsoftware.com/filemaker/faq.shtml). | "utf8" | Optional |

### Result

Returns "OK" on success.

### Description

Sets the certificate directory.  
Pass a string naming a directory holding multiple CA certificates to verify the peer with. The certificate directory must be prepared using the openssl c\_rehash utility. This makes sense only when used in combination with the CURL.SetOptionVerifyPeer option. If CURL.SetOptionVerifyPeer is zero, CURL.SetOptionCAPATH need not even indicate an accessible path. The CURL.SetOptionCAPath function apparently does not work in Windows due to some limitation in openssl. This option is OpenSSL-specific and does nothing if libcurl is built to use GnuTLS.  
  
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 [CAPATH](https://curl.haxx.se/libcurl/c/CURLOPT_CAPATH.html) option in CURL manual.

### Examples

Use system certificates on Linux:

 Set Variable \[ $r ; Value: MBS ( "CURL.Set"; $curl ; "/etc/ssl/certs" ) \]  
### See also

- [CURL.SetOptionCookie](CURLSetOptionCookie.md)
- [CURL.SetOptionDOHSSLVerifyPeer](CURLSetOptionDOHSSLVerifyPeer.md)
- [CURL.SetOptionGet](CURLSetOptionGet.md)
- [CURL.SetOptionHTTPAuth](CURLSetOptionHTTPAuth.md)
- [CURL.SetOptionPort](CURLSetOptionPort.md)
- [CURL.SetOptionPost](CURLSetOptionPost.md)
- [CURL.SetOptionProxyCAPath](CURLSetOptionProxyCAPath.md)
- [CURL.SetOptionPut](CURLSetOptionPut.md)
- [CURL.SetOptionSASLIR](CURLSetOptionSASLIR.md)
- [CURL.SetOptionSSLVerifyPeer](CURLSetOptionSSLVerifyPeer.md)

### Release notes

- **Version 8.0**
    - Changed [CURL.SetOptionCAINFO](http://www.mbsplugins.eu/CURLSetOptionCAINFO.shtml), [CURL.SetOptionCAPATH](http://www.mbsplugins.eu/CURLSetOptionCAPATH.shtml), [CURL.SetOptionCookieFile](http://www.mbsplugins.eu/CURLSetOptionCookieFile.shtml), [CURL.SetOptionCookieJar](http://www.mbsplugins.eu/CURLSetOptionCookieJar.shtml), [CURL.SetOptionIssuerCert](http://www.mbsplugins.eu/CURLSetOptionIssuerCert.shtml), [CURL.SetOptionNETRCFile](http://www.mbsplugins.eu/CURLSetOptionNETRCFile.shtml), [CURL.SetOptionRandomFile](http://www.mbsplugins.eu/CURLSetOptionRandomFile.shtml), [CURL.SetOptionSSHPrivateKeyfile](http://www.mbsplugins.eu/CURLSetOptionSSHPrivateKeyfile.shtml), [CURL.SetOptionSSHPublicKeyfile](http://www.mbsplugins.eu/CURLSetOptionSSHPublicKeyfile.shtml), [CURL.SetOptionSSLCert](http://www.mbsplugins.eu/CURLSetOptionSSLCert.shtml), [CURL.SetOptionSSLKey](http://www.mbsplugins.eu/CURLSetOptionSSLKey.shtml) 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.

### Blog Entries

- [MBS FileMaker Plugin, version 7.6pr3](https://www.mbsplugins.de/archive/2017-12-13/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

Created 18th August 2014 , last changed 29th January 2026

  
[CURL.SetOptionCAInfoBlob](CURLSetOptionCAInfoBlob.md) - [CURL.SetOptionCRLF](CURLSetOptionCRLF.md)

[HTML Version](CURLSetOptionCAPATH.shtml)