CURL.UseSystemCertificates
--------------------------

Read certificate from system and installs them in CURL session,.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [7.2](newinversion72.md) | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes, on macOS and Windows | ❌ No |

MBS( "CURL.UseSystemCertificates"; curl ) 

**MBS**( **"CURL.UseSystemCertificates";** /\* Read certificate from system and installs them in CURL session,. \*/  
**$curl**) /\* The CURL session handle. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |

### Result

Returns number or error.

### Description

Read certificate from system and installs them in CURL session,.  
For macOS and Windows we load the available certificates from keychain or Windows Certificate Store and pass them to CURL. This is better than having no certificates at all.  
Even better is normally to provide a cacert.pem file with only the expected certificates.  
Returns number of certificates loaded.  
  
No longer needed since MBS Plugin v16.0 with CURL 8.18 since CURL will query certificate storage in keychain automatically.  
### Examples

Enable system certificates:

 Set Variable \[$result ; Value:MBS ("CURL.UseSystemCertificates"; $curl )\]  
Set Variable \[$result ; Value:MBS ("[CURL.SetOptionSSLVerifyPeer](CURLSetOptionSSLVerifyPeer.md)"; $curl ; 1)\]  
Set Variable \[$result ; Value:MBS ("[CURL.SetOptionSSLVerifyHost](CURLSetOptionSSLVerifyHost.md)"; $curl ; 2 )\]  
Do download with TLS and system certificates:

 # Start new session   
Set Variable \[ $curl ; Value: MBS ("[CURL.New](CURLNew.md)") \]   
\# Set URL to load (HTTP, HTTPS, FTP, FTPS, SFTP, etc.)   
Set Variable \[ $result ; Value: MBS ("[CURL.SetOptionURL](CURLSetOptionURL.md)"; $curl ; CURL Test::URL ) \]   
\# Use system certificate store for TLS   
Set Variable \[ $result ; Value: MBS ( "CURL.UseSystemCertificates"; $curl ) \]   
\# RUN now   
Set Field \[ CURL Test::Result ; MBS ("[CURL.Perform](CURLPerform.md)"; $curl ) \]   
\# Check result   
Set Field \[ CURL Test::Text ; MBS ("[CURL.GetResultAsText](CURLGetResultAsText.md)"; $curl ; "UTF8") \]   
Set Field \[ CURL Test::debug ; MBS ("[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl ) \]   
\# Cleanup   
Set Variable \[ $result ; Value: MBS ("[CURL.Release](CURLRelease.md)"; $curl ) \]  
### See also

- [CURL.GetDebugMessages](CURLGetDebugMessages.md)
- [CURL.GetResultAsText](CURLGetResultAsText.md)
- [CURL.New](CURLNew.md)
- [CURL.Perform](CURLPerform.md)
- [CURL.Release](CURLRelease.md)
- [CURL.SetOptionSSLVerifyHost](CURLSetOptionSSLVerifyHost.md)
- [CURL.SetOptionSSLVerifyPeer](CURLSetOptionSSLVerifyPeer.md)
- [CURL.SetOptionURL](CURLSetOptionURL.md)

### Release notes

- **Version 10.3**
    - Rewrote [CURL.UseSystemCertificates](https://www.mbsplugins.eu/CURLUseSystemCertificates.shtml) function to work better.
- **Version 7.2**
    - Added [CURL.UseSystemCertificates](http://www.mbsplugins.eu/CURLUseSystemCertificates.shtml) to use system certificates on macOS and Windows.

### Blog Entries

- [Neues MBS FileMaker Plugin 10.3 - Über 6200 Funktionen in einem Plugin](https://www.mbsplugins.de/archive/2020-07-21/Neues_MBS_FileMaker_Plugin_103/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 10.3 - More than 6200 Functions In One Plugin](https://www.mbsplugins.de/archive/2020-07-21/MBS_FileMaker_Plugin_103_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.3pr1](https://www.mbsplugins.de/archive/2020-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 7.2](https://www.mbsplugins.de/archive/2017-05-15/MBS_FileMaker_Plugin_72/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.2pr1](https://www.mbsplugins.de/archive/2017-04-03/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 19th March 2017 , last changed 8th January 2026

  
[CURL.Upkeep](CURLUpkeep.md) - [CURL.Version](CURLVersion.md)

[HTML Version](CURLUseSystemCertificates.shtml)