Rev 1116 | Rev 1122 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1116 | Rev 1117 | ||
---|---|---|---|
Line 1956... | Line 1956... | ||
1956 | } |
1956 | } |
1957 | 1957 | ||
1958 | const ENFORCE_SSL_NO = 0; |
1958 | const ENFORCE_SSL_NO = 0; |
1959 | const ENFORCE_SSL_YES = 1; |
1959 | const ENFORCE_SSL_YES = 1; |
1960 | const ENFORCE_SSL_AUTO = 2; |
1960 | const ENFORCE_SSL_AUTO = 2; |
- | 1961 | ||
- | 1962 | /** |
|
- | 1963 | * @var bool|null |
|
- | 1964 | */ |
|
1961 | private static $sslAvailableCache = null; |
1965 | private static $sslAvailableCache = null; |
1962 | 1966 | ||
1963 | /** |
1967 | /** |
1964 | * @return bool|void|null |
1968 | * @return bool |
1965 | * @throws OIDplusException, OIDplusConfigInitializationException |
1969 | * @throws OIDplusException, OIDplusConfigInitializationException |
1966 | */ |
1970 | */ |
1967 | public static function isSslAvailable() { |
1971 | public static function isSslAvailable(): bool { |
1968 | if (!is_null(self::$sslAvailableCache)) return self::$sslAvailableCache; |
1972 | if (!is_null(self::$sslAvailableCache)) return self::$sslAvailableCache; |
1969 | 1973 | ||
1970 | if (PHP_SAPI == 'cli') { |
1974 | if (PHP_SAPI == 'cli') { |
1971 | self::$sslAvailableCache = false; |
1975 | self::$sslAvailableCache = false; |
1972 | return false; |
1976 | return false; |
Line 2038... | Line 2042... | ||
2038 | OIDplus::cookieUtils()->setcookie('SSL_CHECK', '0', 0, true/*allowJS*/, null/*samesite*/, true/*forceInsecure*/); |
2042 | OIDplus::cookieUtils()->setcookie('SSL_CHECK', '0', 0, true/*allowJS*/, null/*samesite*/, true/*forceInsecure*/); |
2039 | self::$sslAvailableCache = false; |
2043 | self::$sslAvailableCache = false; |
2040 | return false; |
2044 | return false; |
2041 | } |
2045 | } |
2042 | } |
2046 | } |
- | 2047 | } else { |
|
- | 2048 | assert(false); |
|
- | 2049 | return false; |
|
2043 | } |
2050 | } |
2044 | } |
2051 | } |
2045 | } |
2052 | } |
2046 | 2053 | ||
2047 | /** |
2054 | /** |