mirror of
https://github.com/unraid/webgui.git
synced 2026-01-24 10:28:39 -06:00
Merge pull request #1021 from limetech/fix/provisioncert
fix: provision cert issues
This commit is contained in:
@@ -46,7 +46,7 @@ $isRegistered = !empty($remote) && !empty($remote['username']);
|
||||
$certPresent = file_exists($certPath);
|
||||
if ($certPresent) {
|
||||
// renew existing cert
|
||||
$subject = exec("/usr/bin/openssl x509 -subject -noout -in ".escapeshellarg($certPath));
|
||||
$certSubject = exec("/usr/bin/openssl x509 -subject -noout -in ".escapeshellarg($certPath));
|
||||
$isLegacyCert = preg_match('/.*\.unraid\.net$/', $certSubject);
|
||||
$isWildcardCert = preg_match('/.*\.myunraid\.net$/', $certSubject);
|
||||
if ($isLegacyCert || $isWildcardCert) {
|
||||
@@ -57,7 +57,7 @@ if ($certPresent) {
|
||||
}
|
||||
} else {
|
||||
// assume custom cert
|
||||
response_complete(406, '{"error":"'._('Cannot renew a custom cert at').' $certPath"}');
|
||||
response_complete(406, '{"error":"'._('Cannot renew a custom cert at').' '.$certPath.'"}');
|
||||
}
|
||||
} else {
|
||||
// provision new cert
|
||||
@@ -69,7 +69,7 @@ $endpoint = ($certPresent && $isLegacyCert) ? "provisioncert" : "provisionwildca
|
||||
|
||||
$keyfile = @file_get_contents($var['regFILE']);
|
||||
if ($keyfile === false) {
|
||||
response_complete(406, '{"error":"'.('License key required').'"}');
|
||||
response_complete(406, '{"error":"'._('License key required').'"}');
|
||||
}
|
||||
$keyfile = @base64_encode($keyfile);
|
||||
$ethX = 'eth0';
|
||||
|
||||
Reference in New Issue
Block a user