Added ConnectionSecurityType::TLS

This commit is contained in:
the-djmaze 2024-03-27 01:24:34 +01:00
parent 7213395118
commit 6be84f8ab4
2 changed files with 4 additions and 6 deletions

View file

@ -20,6 +20,7 @@ abstract class ConnectionSecurityType
{ {
const NONE = 0; const NONE = 0;
const SSL = 1; const SSL = 1;
const TLS = 1;
const STARTTLS = 2; const STARTTLS = 2;
const AUTO_DETECT = 9; const AUTO_DETECT = 9;

View file

@ -224,17 +224,14 @@ class Domain implements \JsonSerializable
*/ */
public static function StrConnectionSecurityTypeToCons(string $sType) : int public static function StrConnectionSecurityTypeToCons(string $sType) : int
{ {
$iSecurityType = ConnectionSecurityType::NONE;
switch (\strtoupper($sType)) switch (\strtoupper($sType))
{ {
case 'SSL': case 'SSL':
$iSecurityType = ConnectionSecurityType::SSL; return ConnectionSecurityType::SSL;
break;
case 'TLS': case 'TLS':
$iSecurityType = ConnectionSecurityType::STARTTLS; return ConnectionSecurityType::STARTTLS;
break;
} }
return $iSecurityType; return ConnectionSecurityType::NONE;
} }
#[\ReturnTypeWillChange] #[\ReturnTypeWillChange]