aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorKate <26026535+provokateurin@users.noreply.github.com>2024-09-30 10:24:20 +0200
committerGitHub <noreply@github.com>2024-09-30 10:24:20 +0200
commit6949e21c097d19d965901271dc5aece4401168e5 (patch)
tree4e135726af46075668e2f7bb820f01b200336f12 /lib/private
parentb2fa6ff1974385d2556126dd91fbc05ff4ed19eb (diff)
parentc4ffd8443949db03cda56deb76b474dc583189f7 (diff)
downloadnextcloud-server-6949e21c097d19d965901271dc5aece4401168e5.tar.gz
nextcloud-server-6949e21c097d19d965901271dc5aece4401168e5.zip
Merge pull request #48317 from nextcloud/backport/48307/stable30
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Security/Certificate.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/Security/Certificate.php b/lib/private/Security/Certificate.php
index b9d84caeca3..1551694c21f 100644
--- a/lib/private/Security/Certificate.php
+++ b/lib/private/Security/Certificate.php
@@ -42,6 +42,16 @@ class Certificate implements ICertificate {
$info = openssl_x509_parse($data);
if (!is_array($info)) {
+ // There is a non-standardized certificate format only used by OpenSSL. Replace all
+ // separators and try again.
+ $data = str_replace(
+ ['-----BEGIN TRUSTED CERTIFICATE-----', '-----END TRUSTED CERTIFICATE-----'],
+ ['-----BEGIN CERTIFICATE-----', '-----END CERTIFICATE-----'],
+ $data,
+ );
+ $info = openssl_x509_parse($data);
+ }
+ if (!is_array($info)) {
throw new \Exception('Certificate could not get parsed.');
}