Explorar el Código

fixed bug in show x509 cert
fixed bug by analyze index.txt

rajven hace 7 meses
padre
commit
aace67e854
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 2 1
      addons/show_client_crt.sh
  2. 1 1
      html/admin/functions.php

+ 2 - 1
addons/show_client_crt.sh

@@ -81,7 +81,8 @@ main() {
     
     # Output results
     echo "<cert>"
-    openssl x509 -in "${CERT_FILE}" -notext
+#    openssl x509 -in "${CERT_FILE}" -notext
+    openssl x509 -in "${CERT_FILE}"
     echo "</cert>"
     echo
     echo "<key>"

+ 1 - 1
html/admin/functions.php

@@ -149,7 +149,7 @@ function getAccountList($server) {
 	        if (empty(trim($line))) continue;
     	        $parts = preg_split('/\s+/', $line);
         	if (count($parts) >= 1 && $parts[0] === 'V') { // Только валидные сертификаты
-		    $username = ltrim($parts[4], '/CN=');
+		    $username = substr(strstr(end($parts), '/CN='), 4);
                     $accounts[$username] = [
 	                "username" => $username,
     	                "ip" => null,