Skip to content
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

fix: Allow to disable ssl verification for object storage #47238

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/private/Files/ObjectStore/S3ConnectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ protected function parseParams($params) {
$params['port'] = (isset($params['use_ssl']) && $params['use_ssl'] === false) ? 80 : 443;
}
$params['verify_bucket_exists'] = $params['verify_bucket_exists'] ?? true;
$params['ssl_verify'] = $params['ssl_verify'] ?? true;

if ($params['s3-accelerate']) {
$params['verify_bucket_exists'] = false;
Expand Down Expand Up @@ -100,7 +101,7 @@ public function getConnection() {
'csm' => false,
'use_arn_region' => false,
'http' => [
'verify' => $this->getCertificateBundlePath(),
'verify' => $this->params['ssl_verify'] ? $this->getCertificateBundlePath() : false,
// Timeout for the connection to S3 server, not for the request.
'connect_timeout' => 5
],
Expand Down
7 changes: 6 additions & 1 deletion lib/private/Files/ObjectStore/S3ObjectTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public function readObject($urn) {
'http' => [
'protocol_version' => $request->getProtocolVersion(),
'header' => $headers,
]
],
'ssl' => [],
];
$bundle = $this->getCertificateBundlePath();
if ($bundle) {
Expand All @@ -63,6 +64,10 @@ public function readObject($urn) {
];
}

if ($this->params['ssl_verify'] === false) {
$opts['ssl']['verify_peer'] = false;
}

if ($this->getProxy()) {
$opts['http']['proxy'] = $this->getProxy();
$opts['http']['request_fulluri'] = true;
Expand Down
Loading