psugand / CodeIgniter-S3

Amazon S3 Library for CodeIgniter
http://prashant.es
241 stars 115 forks source link

Correct value for CURLOPT_SSL_VERIFYHOST #6

Closed rasmusbe closed 11 years ago

rasmusbe commented 11 years ago

The correct value for CURLOPT_SSL_VERIFYHOST is 2, not 1.

From the libcurl documentation:

When CURLOPT_SSL_VERIFYHOST 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).