Source of file SSLCheck.php
Size: 0,889 Bytes - Last Modified: 2021-12-24T06:46:44+00:00
/var/www/docs.ssmods.com/process/src/src/EnvironmentCheck/SSLCheck.php
1234567891011121314151617181920212223242526272829 | <?php namespace ElliotSawyer\SSLMySQLDatabase; use SilverStripe\EnvironmentCheck\EnvironmentCheck; use SilverStripe\ORM\DB; if (!interface_exists(EnvironmentCheck::class)) return; class SSLCheck implements EnvironmentCheck { public function check() { $q = DB::query("SHOW STATUS LIKE '%ssl_cipher'"); $status = $q->nextRecord(); if (isset($status['Variable_name']) && isset($status['Value'])) { $variableName = $status['Variable_name']; $value = $status['Value']; if($variableName === 'Ssl_cipher' || $variableName === 'ssl_cipher') { return strlen($value) > 0 ? [EnvironmentCheck::OK, 'OK'] : [EnvironmentCheck::ERROR, 'FAIL']; } } return [EnvironmentCheck::WARNING, 'MySQL is connected but using an insecure connection']; } } |