CURL.SetOptionSSLCertType
-------------------------

Sets the format of the certificate.

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

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

**MBS**( **"CURL.SetOptionSSLCertType";** /\* Sets the format of the certificate. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**; /\* The type string.e.g. "PEM" \*/   
**$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 type string. | "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](https://www.monkeybreadsoftware.com/filemaker/faq.shtml). | "UTF8" | Optional |

### Result

Returns "OK" on success.

### Description

Sets the format of the certificate.  
Pass a string as parameter. The string should be the format of your certificate. Supported formats are "PEM", "DER" and "P12" for PKCS#12-encoded files.  
  
Due to a bug the P12 format was not working in 7.4 or earlier. This was fixed in 7.5.  
See also [SSLCERTTYPE](https://curl.haxx.se/libcurl/c/CURLOPT_SSLCERTTYPE.html) option in CURL manual.

### Examples

Set a client SSL certificate:

 Set Variable \[$r ; Value:MBS ("[CURL.SetOptionSSLCert](CURLSetOptionSSLCert.md)"; $curl ; "/some/certfile.pem")\]  
Set Variable \[$r ; Value:MBS ("CURL.SetOptionSSLCertType"; $curl ; "PEM")\]  
Set Variable \[$r ; Value:MBS ("[CURL.SetOptionKeyPassword](CURLSetOptionKeyPassword.md)"; $curl ; "secret")\]  
Use P12 certificate with pfx file:

 Set Variable \[$r ; Value:MBS ("[CURL.SetOptionSSLCert](CURLSetOptionSSLCert.md)"; $curl ; "/some/certfile.pfx")\]  
Set Variable \[$r ; Value:MBS ("CURL.SetOptionSSLCertType"; $curl ; "P12")\]  
Set Variable \[$r ; Value:MBS ("[CURL.SetOptionKeyPassword](CURLSetOptionKeyPassword.md)"; $curl ; "secret")\]  
### See also

- [CURL.Perform](CURLPerform.md)
- [CURL.SetOptionSSHAuthTypes](CURLSetOptionSSHAuthTypes.md)
- [CURL.SetOptionSSLCert](CURLSetOptionSSLCert.md)
- [CURL.SetOptionSSLCertBlob](CURLSetOptionSSLCertBlob.md)
- [CURL.SetOptionSSLKey](CURLSetOptionSSLKey.md)
- [CURL.SetOptionSSLKeyBlob](CURLSetOptionSSLKeyBlob.md)
- [CURL.SetOptionSSLOptions](CURLSetOptionSSLOptions.md)
- [CURL.SetOptionSSLVerifyPeer](CURLSetOptionSSLVerifyPeer.md)
- [CURL.SetOptionSSLVersion](CURLSetOptionSSLVersion.md)
- [CURL.SetOptionTLSAuthType](CURLSetOptionTLSAuthType.md)

### Blog Entries

- [Translating Insert from URL options for CURL to MBS Plugin calls](https://www.mbsplugins.de/archive/2020-12-14/Translating_Insert_from_URL_op/monkeybreadsoftware_blog_filemaker)
- [Using Apple's Global Service Exchange web service in FileMaker](https://www.mbsplugins.de/archive/2019-09-04/Using_Apples_Global_Service_Ex/monkeybreadsoftware_blog_filemaker)
- [Using Apple's Global Service Exchange web service in FileMaker](https://www.mbsplugins.de/archive/2017-02-21/Using_Apples_Global_Service_Ex/monkeybreadsoftware_blog_filemaker)

Created 18th August 2014 , last changed 19th April 2018

  
[CURL.SetOptionSSLCertBlob](CURLSetOptionSSLCertBlob.md) - [CURL.SetOptionSSLCipherList](CURLSetOptionSSLCipherList.md)

[HTML Version](CURLSetOptionSSLCertType.shtml)