-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Certificate manager fallback #42763
base: master
Are you sure you want to change the base?
Certificate manager fallback #42763
Conversation
6c746cf
to
16c418e
Compare
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. |
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. |
I can do that, yeah. I was wondering if there was a special reason of using |
16c418e
to
ddb5f48
Compare
…rnal to data CertificateManager doesn't work propertly if the files_external app is disabled, so let's store directly in /data/certificate_manager the bundled certificates. This always has to be done on local disk as curl currently requires a path to the cert bundle. 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. Signed-off-by: Thomas Citharel <[email protected]>
Signed-off-by: Thomas Citharel <[email protected]>
ddb5f48
to
1171f3c
Compare
|
||
public function __construct( | ||
protected View $view, | ||
protected IConfig $config, | ||
protected LoggerInterface $logger, | ||
protected ISecureRandom $random, | ||
protected IAppManager $appManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current logic still goes through the NC fs instead of always storing the bundle on disk but your PR description implies this wouldn't be the case anymore
protected string $newRootPath; | ||
|
||
public function __construct(protected View $view, protected IConfig $config) { | ||
$this->newRootPath = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/data/certificate_manager'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double /data
} | ||
|
||
protected function shouldRun(): bool { | ||
return $this->view->file_exists($this->newRootPath . self::ROOT_CERTS_FILENAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like it's missing a negation
We are using S3 storage and see the SSL cert error due to not having |
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
Checklist