Repository: WordPress/Requests (language: php)

Issue:
cURL incompatibility with Kaspersky (kesl)
## Summary

I'm facing an issue with some servers having kesl service (Kaspersky) installed and running.

Sometimes wp_remote_* calls fails with error:
```
Scaricamento del pacchetto di installazione da https://downloads.wordpress.org/plugin/jetpack.10.1.zip...
Warning: Il download non è andato a buon fine. "cURL error 18: transfer closed with 332690 bytes remaining to read"
```

The number of bytes is completely randomic.
Since it's not consistent, I've prepared this script to be run over and over (without wp-cli cache of course):

```
while :; do  wp plugin install jetpack && wp plugin delete jetpack && rm -rf /root/.wp-cli/cache/*; done
```

After digging a lot into WpOrg\Requests\Transport\cURL implementation I've found these lines being the cause of the issue:
```php
<?php
// Force closing the connection for old versions of cURL (<7.22).
if (!isset($headers['Connection'])) {
        $headers['Connection'] = 'close';
}
```

Disabling these lines, the issue disappear. Why aren't we checking the cURL version here?
I would then suggest these changes:
1) Add a new const const CURL_7_22_0 = 0x071600
2) Check the version and add that header only if needed

## Your environment
<!-- Please include as many details as relevant about the environment you experienced the bug in. -->

| Environment                                                  | Answer
| ------------------------------------------------------------ | -------
| Operating system and version (e.g. Ubuntu 20.04, CentOS, tried both)
| PHP version                                                  | 7.4 (tried others as well)
| Requests version                                             | provided with WordPress latest
| Autoloader used                                              | WordPress
| Link to your project                                         | into a vpn, not accessible through the internet

## Tested against `develop` branch?
- [ ] I have verified the issue still exists in the `develop` branch of Requests.




Discussion / hints:
As reported here: https://core.trac.wordpress.org/ticket/54588

Fix patch:
diff --git a/src/Transport/Curl.php b/src/Transport/Curl.php
index 289d9b15b..9a9f03f93 100644
--- a/src/Transport/Curl.php
+++ b/src/Transport/Curl.php
@@ -25,6 +25,7 @@
 final class Curl implements Transport {
 	const CURL_7_10_5 = 0x070A05;
 	const CURL_7_16_2 = 0x071002;
+	const CURL_7_22_0 = 0x071600;
 
 	/**
 	 * Raw HTTP data
@@ -363,7 +364,7 @@ private function setup_handle($url, $headers, $data, $options) {
 		$options['hooks']->dispatch('curl.before_request', [&$this->handle]);
 
 		// Force closing the connection for old versions of cURL (<7.22).
-		if (!isset($headers['Connection'])) {
+		if ($this->version < self::CURL_7_22_0 && !isset($headers['Connection'])) {
 			$headers['Connection'] = 'close';
 		}
 


Test patch: