Skip to content

Commit

Permalink
Let PHP automatically detect the preferred TLS version (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
radli committed Jan 19, 2023
1 parent 7199860 commit c10ea7f
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/File/Loader.php
Expand Up @@ -264,17 +264,6 @@ protected function setCurlOptions($curl)
if (!@curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true)) {
throw new RuntimeException('curl_setopt(CURLOPT_FOLLOWLOCATION) failed.');
}
if (defined('CURL_SSLVERSION_TLSv1_1')) {
if (!@curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_1)) {
throw new RuntimeException('curl_setopt(CURLOPT_SSLVERSION) failed.');
}
} else {
// Manually checked that CURL_SSLVERSION_TLSv1_1 is 5 for any version of curl from 7.34.0 to 7.61.0
// See for example https://github.com/curl/curl/blob/curl-7_34_0/include/curl/curl.h#L1668
if (!@curl_setopt($curl, CURLOPT_SSLVERSION, 5)) {
throw new RuntimeException('curl_setopt(CURLOPT_SSLVERSION) failed.');
}
}
}

/**
Expand Down

0 comments on commit c10ea7f

Please sign in to comment.