Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let PHP automatically detect the preferred TLS version #841

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/File/Loader.php
Original file line number Diff line number Diff line change
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