composer package updates
[openemr.git] / vendor / zendframework / zend-mail / src / Protocol / ProtocolTrait.php
blob2a9bbf16a7ff789b4a0e9482697aa98ec37a74e6
1 <?php
2 /**
3 * @see https://github.com/zendframework/zend-mail for the canonical source repository
4 * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
5 * @license https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License
6 */
8 namespace Zend\Mail\Protocol;
10 /**
11 * https://bugs.php.net/bug.php?id=69195
13 trait ProtocolTrait
15 public function getCryptoMethod()
17 // Allow the best TLS version(s) we can
18 $cryptoMethod = STREAM_CRYPTO_METHOD_TLS_CLIENT;
20 // PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
21 // so add them back in manually if we can
22 if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
23 $cryptoMethod |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
24 $cryptoMethod |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
27 return $cryptoMethod;