Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

CURL.SetOptionSSLVerifyHost

Sets whether to verify host.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CURL 2.5 Yes Yes Yes Yes Yes

MBS( "CURL.SetOptionSSLVerifyHost"; Handle; Value )

Parameters

Parameter Description Example value
Handle The CURL session handle. $curl
Value Whether to verify host. 1

Result

Returns "OK" on success.

Description

Sets whether to verify host.
This option determines whether libcurl verifies that the server cert is for the server it is known as.

When negotiating a SSL connection, the server sends a certificate indicating its identity.

When value is 2, that certificate must indicate that the server is the server to which you meant to connect, or the connection fails.

Curl considers the server the intended one when the Common Name field or a Subject Alternate Name field in the certificate matches the host name in the URL to which you told Curl to connect.

When the value is 1, the certificate must contain a Common Name field, but it doesn't matter what name it says. (This is not ordinarily a useful setting).

When the value is 0, the connection succeeds regardless of the names in the certificate.

The default, since 7.10, is 2.

This option controls checking the server's claimed identity. The server could be lying. To control lying, see CURL SetOptionSSLVerifyPeer.

see also
http://www.mbsplugins.de/archive/2013-01-31/SSL_Security_with_CURL/monkeybreadsoftware_blog_archive

Examples

Disable SSL Verification:

MBS( "CURL.SetOptionSSLVerifyPeer"; $curl; 0 )
MBS( "CURL.SetOptionSSLVerifyHost"; $curl; 0 )

Enables verification and uses cacert.pem file for certificates:

MBS( "CURL.SetOptionCAINFO"; $curl; $cacertPath )
MBS( "CURL.SetOptionSSLVerifyHost"; $curl; 2 )
MBS( "CURL.SetOptionSSLVerifyPeer"; $curl; 1 )

See also

Example Databases


CURL.SetOptionSSLSessionIDCache   -   CURL.SetOptionSSLVerifyPeer

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins