server icon indicating copy to clipboard operation
server copied to clipboard

Certificate manager fallback

Open tcitworld opened this issue 1 year ago • 3 comments

  • Resolves: https://github.com/nextcloud/server/issues/42464#issuecomment-1891009733 https://github.com/nextcloud/integration_google/issues/132

Summary

CertificateManager doesn't seem to work propertly if the files_external app is disabled (the files get put in /tmp for no reason I know of), so let's store directly in /data/certificate_manager the bundled certificates. This always has to be done on local disk (even with primary ObjectStorage) as curl currently requires a path to the cert bundle.

Another way of doing it would be directly using a file given by the ITempManager, but it would need rebuilding the bundle and rewriting the file after each cron call. 😱

When we require PHP 8.1 we will be able to simply store the certificate bundle in database/memory/cache and pass it through the CURLOPT_SSLCERT_BLOB option.

TODO

  • [ ] adapt tests

Checklist

tcitworld avatar Jan 14 '24 19:01 tcitworld

Once upon a time, the whole logic was in files_external, iirc, as it started to with the support of custom CAs against file serves.

blizzz avatar Jan 15 '24 16:01 blizzz

The path (and data) will be different when switching on or off files_external, right. That's a little unpredictable and confusing. When going to a different location, go fully there, and do a migration of the old data, if existing.

blizzz avatar Jan 15 '24 17:01 blizzz

I can do that, yeah.

I was wondering if there was a special reason of using files_external for that in the first place, but it doesn't seem to me 5d61b85a1dace6ebb41025deaad019af8b3e5145

tcitworld avatar Jan 15 '24 18:01 tcitworld

We are using S3 storage and see the SSL cert error due to not having files_external enabled, this PR is fantastic.

botsarenthuman avatar Mar 29 '24 23:03 botsarenthuman