Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CURL.SetOptionSSLCertType

Sets the format of the certificate.

Component Version macOS Windows Linux Server iOS SDK
CURL 2.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetOptionSSLCertType"; curl; Value { ; Encoding } )   More

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.
"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 option in CURL manual.

Examples

Set a client SSL certificate:

Set Variable [$r; Value:MBS("CURL.SetOptionSSLCert"; $curl; "/some/certfile.pem")]
Set Variable [$r; Value:MBS("CURL.SetOptionSSLCertType"; $curl; "PEM")]
Set Variable [$r; Value:MBS("CURL.SetOptionKeyPassword"; $curl; "secret")]

Use P12 certificate with pfx file:

Set Variable [$r; Value:MBS("CURL.SetOptionSSLCert"; $curl; "/some/certfile.pfx")]
Set Variable [$r; Value:MBS("CURL.SetOptionSSLCertType"; $curl; "P12")]
Set Variable [$r; Value:MBS("CURL.SetOptionKeyPassword"; $curl; "secret")]

See also

Blog Entries

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


CURL.SetOptionSSLCertBlob - CURL.SetOptionSSLCipherList