|
@@ -14,10 +14,34 @@ echoLine("tsDay:" . totalDays());
|
|
|
//set_time_limit(15); # 设置执行超时时间
|
|
|
//
|
|
|
|
|
|
-$arr = [1 => "山楂", 5 => "芍药", 3 => "陈皮", 7 => "鸡内金"];
|
|
|
|
|
|
-uksort($arr, function ($a, $b) {
|
|
|
- return intval($a) - intval($b);
|
|
|
-});
|
|
|
|
|
|
-var_dump($arr);
|
|
|
+$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";
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|