1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace loyalsoft;
- include __DIR__ . '/main.php';
- //var_dump(__DIR__);
- echoLine("phpver: " . PHP_VERSION . PHP_EOL);
- echoLine("tsDay:" . totalDays());
- //SelfChecker::CheckAll();
- //
- //set_time_limit(15); # 设置执行超时时间
- //
- $url = 'https://fancyssl.hboeck.de/';
- $protocols = [
- 'TLS1.0' => ['protocol' => CURL_SSLVERSION_TLSv1_0, 'sec' => false],
- 'TLS1.1' => ['protocol' => CURL_SSLVERSION_TLSv1_1, 'sec' => false],
- 'TLS1.2' => ['protocol' => CURL_SSLVERSION_TLSv1_2, 'sec' => true],
- 'TLS1.3' => ['protocol' => CURL_SSLVERSION_TLSv1_3, 'sec' => true],
- ];
- foreach ($protocols as $name => $value) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_SSLVERSION, $value['protocol']);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $response = curl_exec($ch) !== false;
- if ($value['sec'] && !$response) {
- echo "Secure $name not supported =( \n";
- } elseif ($value['sec'] && $response) {
- echo "Ok! Secure $name supported \n";
- } elseif (!$value['sec'] && $response) {
- echo "OK! Insecure $name supported =( \n";
- } elseif (!$value['sec'] && !$response) {
- echo "Insecure $name not supported\n";
- }
- }
|