Skip to content

Commit 9af9395

Browse files
kesselbAndyScherzinger
authored andcommitted
fix(s3): make data integrity protections opt-in
Signed-off-by: Daniel Kesselberg <[email protected]>
1 parent db6e711 commit 9af9395

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

config/config.sample.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,6 +1918,12 @@
19181918
// optional: Maximum number of retry attempts for failed S3 requests
19191919
// Default: 5
19201920
'retriesMaxAttempts' => 5,
1921+
// Data Integrity Protections for Amazon S3 (https://docs.aws.amazon.com/sdkref/latest/guide/feature-dataintegrity.html)
1922+
// Valid values are "when_required" (default) and "when_supported".
1923+
// To ensure compatibility with 3rd party S3 implementations, Nextcloud disables it by default. However, if you are
1924+
// using Amazon S3 (or any other implementation that supports it) we recommend enabling it by using "when_supported".
1925+
'request_checksum_calculation' => 'when_required',
1926+
'response_checksum_validation' => 'when_required',
19211927
],
19221928
],
19231929

lib/private/Files/ObjectStore/S3ConnectionTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,14 @@ public function getConnection() {
128128

129129
if (isset($this->params['request_checksum_calculation'])) {
130130
$options['request_checksum_calculation'] = $this->params['request_checksum_calculation'];
131+
} else {
132+
$options['request_checksum_calculation'] = 'when_required';
131133
}
132134

133135
if (isset($this->params['response_checksum_validation'])) {
134136
$options['response_checksum_validation'] = $this->params['response_checksum_validation'];
137+
} else {
138+
$options['response_checksum_validation'] = 'when_required';
135139
}
136140

137141
if ($this->getProxy()) {

0 commit comments

Comments
 (0)