![]() |
Bearsampp 2026.7.11
|
Public Member Functions | |
| createCrt ($name, $destPath=null) | |
| delSslCertificate () | |
| delSslCertificateHandler ($window, $id, $ctrl, $param1, $param2) | |
| existsCrt ($name) | |
| genSslCertificate () | |
| genSslCertificateHandler ($window, $id, $ctrl, $param1, $param2) | |
| getCrts () | |
| isExpired ($name) | |
| makeRootCa () | |
| rebuildAllCerts () | |
| removeCrt ($name, $destPath=null) | |
Private Member Functions | |
| ensureMkcertExeExists () | |
| ensureRootCaExists ($destPath) | |
| ensureSslDirExists () | |
| validateCertificateName ($name) | |
Definition at line 11 of file class.openssl.php.
| createCrt | ( | $name, | |
| $destPath = null ) |
Creates a certificate with the specified name and destination path.
| string | $name | The name of the certificate. |
| string | null | $destPath | The destination path where the certificate files will be saved. If null, the default SSL path is used. |
Definition at line 187 of file class.openssl.php.
References $result, ensureMkcertExeExists(), ensureRootCaExists(), ensureSslDirExists(), Log\error(), Batch\exec(), Path\formatWindowsPath(), Path\getMkcertExe(), Path\getOpenSslExe(), Log\trace(), and validateCertificateName().
Referenced by makeRootCa(), and rebuildAllCerts().
| delSslCertificate | ( | ) |
Displays a WinBinder GUI for deleting an SSL certificate.
Definition at line 293 of file class.openssl.php.
References $bearsamppLang, Lang\BUTTON_BROWSE, Lang\BUTTON_CANCEL, Lang\BUTTON_DELETE, Lang\DELSSL_TITLE, Path\formatWindowsPath(), Path\getSslPath(), Lang\NAME, and Lang\TARGET.
| delSslCertificateHandler | ( | $window, | |
| $id, | |||
| $ctrl, | |||
| $param1, | |||
| $param2 ) |
Handler for the SSL certificate deletion WinBinder GUI.
Definition at line 323 of file class.openssl.php.
References $bearsamppLang, WinBinder\CTRL_ID, WinBinder\CTRL_OBJ, Lang\DELSSL_DELETED, Lang\DELSSL_DELETED_ERROR, Lang\DELSSL_TITLE, Lang\ERROR_FILE_NOT_FOUND, Path\formatUnixPath(), Lang\GENSSL_PATH, and getCrts().
|
private |
Ensures that the mkcert executable exists, attempting to download it if missing.
Definition at line 34 of file class.openssl.php.
References Log\error(), and Path\getMkcertExe().
Referenced by createCrt(), ensureRootCaExists(), and makeRootCa().
|
private |
Ensures that the Root CA exists, creating it if necessary.
| string | $destPath | The destination path. |
Definition at line 260 of file class.openssl.php.
References $result, ensureMkcertExeExists(), Log\error(), Batch\exec(), Path\formatWindowsPath(), Path\getMkcertExe(), Path\getMkcertRootCaName(), and Log\info().
Referenced by createCrt().
|
private |
Ensures that the SSL directory exists, creating it if necessary.
Definition at line 50 of file class.openssl.php.
References Log\error(), Path\getSslPath(), Log\info(), and Log\warning().
Referenced by createCrt(), getCrts(), and removeCrt().
| existsCrt | ( | $name | ) |
Checks if a certificate with the specified name exists.
| string | $name | The name of the certificate. |
Definition at line 376 of file class.openssl.php.
References Path\getSslPath().
| genSslCertificate | ( | ) |
Displays a WinBinder GUI for generating an SSL certificate.
Definition at line 387 of file class.openssl.php.
References $bearsamppLang, Lang\BUTTON_BROWSE, Lang\BUTTON_CANCEL, Lang\BUTTON_SAVE, Path\formatWindowsPath(), Lang\GENSSL_TITLE, Path\getSslPath(), Lang\NAME, and Lang\TARGET.
| genSslCertificateHandler | ( | $window, | |
| $id, | |||
| $ctrl, | |||
| $param1, | |||
| $param2 ) |
Handler for the SSL certificate generation WinBinder GUI.
Definition at line 417 of file class.openssl.php.
References $bearsamppLang, WinBinder\CTRL_ID, WinBinder\CTRL_OBJ, Path\formatUnixPath(), Lang\GENSSL_CREATED, Lang\GENSSL_CREATED_ERROR, Lang\GENSSL_PATH, and Lang\GENSSL_TITLE.
| getCrts | ( | ) |
Retrieves existing certificates from the SSL directory.
Definition at line 460 of file class.openssl.php.
References ensureSslDirExists().
Referenced by delSslCertificateHandler(), and rebuildAllCerts().
| isExpired | ( | $name | ) |
Checks if a certificate with the specified name is expired or about to expire.
| string | $name | The name of the certificate. |
Definition at line 482 of file class.openssl.php.
References Log\error(), Path\getSslPath(), Log\trace(), and Log\warning().
| makeRootCa | ( | ) |
Creates a new Root CA and reinstalls it, then rebuilds all certificates.
Definition at line 93 of file class.openssl.php.
References $result, createCrt(), ensureMkcertExeExists(), Log\error(), Batch\exec(), Path\formatWindowsPath(), Path\getMkcertExe(), Path\getMkcertRootCaName(), Path\getSslPath(), Log\info(), and rebuildAllCerts().
| rebuildAllCerts | ( | ) |
Rebuilds all existing certificates in the SSL directory.
Definition at line 138 of file class.openssl.php.
References createCrt(), Log\error(), getCrts(), and Log\info().
Referenced by makeRootCa().
| removeCrt | ( | $name, | |
| $destPath = null ) |
Removes a certificate with the specified name.
| string | $name | The name of the certificate. |
| string | null | $destPath | The destination path where the certificate files are saved. If null, the default SSL path is used. |
Definition at line 533 of file class.openssl.php.
References ensureSslDirExists(), Log\error(), Log\info(), and Log\warning().
|
private |
Validates the certificate name to prevent command injection attacks. Requires names to start with alphanumeric character to prevent mkcert flag injection. Uses filesystem-safe whitelist (same as removeCrt) to support existing cert names and prevent CMD metacharacter injection. Allows: alphanumeric, dots, dashes, underscores.
| string | $name | The certificate name to validate. |
Definition at line 163 of file class.openssl.php.
Referenced by createCrt().
|
private |
Definition at line 26 of file class.openssl.php.
|
private |
Definition at line 25 of file class.openssl.php.
|
private |
Definition at line 24 of file class.openssl.php.
|
private |
Definition at line 22 of file class.openssl.php.
|
private |
Definition at line 21 of file class.openssl.php.
|
private |
Definition at line 20 of file class.openssl.php.
|
private |
Definition at line 23 of file class.openssl.php.
|
private |
Definition at line 18 of file class.openssl.php.
|
private |
Definition at line 15 of file class.openssl.php.
|
private |
Definition at line 17 of file class.openssl.php.
|
private |
Definition at line 14 of file class.openssl.php.
|
private |
Definition at line 13 of file class.openssl.php.
|
private |
Definition at line 16 of file class.openssl.php.