@@ -143,9 +143,10 @@ class Client
143143 */
144144 protected $ verifyhost = 2 ;
145145 /**
146- * @var int
146+ * @var int Corresponds to CURL_SSLVERSION_DEFAULT. Other CURL_SSLVERSION_ values are supported when in socket mode,
147+ * and in socket mode different values from 0 to 7, with old php versions not supporting all of them
147148 */
148- protected $ sslversion = 0 ; // corresponds to CURL_SSLVERSION_DEFAULT. Other CURL_SSLVERSION_ values are supported
149+ protected $ sslversion = 0 ; //
149150 /**
150151 * @var string
151152 */
@@ -585,6 +586,7 @@ public function setSSLVerifyHost($i)
585586 * Set attributes for SSL communication: SSL version to use. Best left at 0 (default value): let PHP decide.
586587 *
587588 * @param int $i use CURL_SSLVERSION_ constants. When in socket mode, use values 2 (SSLv2) to 7 (TLSv1.3). 0 for auto
589+ * (note that old php versions do not support all TLS versions)
588590 * @return $this
589591 * @deprecated use setOption
590592 */
@@ -1073,16 +1075,16 @@ protected function sendViaSocket($req, $method, $server, $port, $path, $opts)
10731075 case 3 : // SSLv3
10741076 $ contextOptions ['ssl ' ]['crypto_method ' ] = STREAM_CRYPTO_METHOD_SSLv3_CLIENT;
10751077 break ;
1076- case 4 : // TLSv1.0
1078+ case 4 : // TLSv1.0 - not always available
10771079 $ contextOptions ['ssl ' ]['crypto_method ' ] = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT;
10781080 break ;
1079- case 5 : // TLSv1.1
1081+ case 5 : // TLSv1.1 - not always available
10801082 $ contextOptions ['ssl ' ]['crypto_method ' ] = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
10811083 break ;
1082- case 6 : // TLSv1.2
1084+ case 6 : // TLSv1.2 - not always available
10831085 $ contextOptions ['ssl ' ]['crypto_method ' ] = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
10841086 break ;
1085- case 7 : // TLSv1.3
1087+ case 7 : // TLSv1.3 - not always available
10861088 if (defined ('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT ' )) {
10871089 $ contextOptions ['ssl ' ]['crypto_method ' ] = STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT;
10881090 } else {
0 commit comments