-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Is your feature request related to a problem? Please describe.
I can't access S3 object store using self-signed certificates, such as a local-only minio cluster.
Describe the solution you'd like
I want to set ssl context options in config.php in the format
'objectstore' => array (
'class' => '\\OC\\Files\\ObjectStore\\S3',
'arguments' => array(
'bucket' => 'mynextcloud',
'autocreate' => true,
'key' => 'REDACTED',
'secret' => 'REDACTED',
'hostname' => '<your host>',
'port' => '<your port>',
'region' => 'optional',
'use_path_style' => true,
'use_ssl' => true,
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' -> true,
),
),
https://www.php.net/manual/en/context.ssl.php
just like it's done in https://github.com/nextcloud/server/blob/master/lib/private/Mail/Mailer.php for email, to ignore self-signed tls certs.
Describe alternatives you've considered
I am currently patching https://github.com/nextcloud/server/blob/master/lib/private/Files/ObjectStore/S3ObjectTrait.php from
$opts = [
'http' => [
'protocol_version' => $request->getProtocolVersion(),
'header' => $headers,
],
];
to
$opts = [
'http' => [
'protocol_version' => $request->getProtocolVersion(),
'header' => $headers,
],
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
],
];
Additional context
I also have to append the self-signed CA certificate to ca-root-nss.crt , or /usr/local/share/certs/ca-root-nss.crt in my case, on freebsd 13.0.