Skip to content

Commit befd8dc

Browse files
authored
Merge pull request ceph#56860 from clwluvw/rgw-crypt-ssl
rgw: eliminate ssl enforcement for sse-s3 encryption Reviewed-by: Casey Bodley <[email protected]>
2 parents a0ddd29 + 8315b7d commit befd8dc

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/rgw/rgw_crypt.cc

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,13 +1149,13 @@ int rgw_s3_prepare_encrypt(req_state* s, optional_yield y,
11491149
crypt_attributes.get(X_AMZ_SERVER_SIDE_ENCRYPTION);
11501150
if (! req_sse.empty()) {
11511151

1152-
if (s->cct->_conf->rgw_crypt_require_ssl &&
1153-
!rgw_transport_is_secure(s->cct, *s->info.env)) {
1154-
ldpp_dout(s, 5) << "ERROR: insecure request, rgw_crypt_require_ssl is set" << dendl;
1155-
return -ERR_INVALID_REQUEST;
1156-
}
1157-
11581152
if (req_sse == "aws:kms") {
1153+
if (s->cct->_conf->rgw_crypt_require_ssl &&
1154+
!rgw_transport_is_secure(s->cct, *s->info.env)) {
1155+
ldpp_dout(s, 5) << "ERROR: insecure request, rgw_crypt_require_ssl is set" << dendl;
1156+
return -ERR_INVALID_REQUEST;
1157+
}
1158+
11591159
std::string_view context =
11601160
crypt_attributes.get(X_AMZ_SERVER_SIDE_ENCRYPTION_CONTEXT);
11611161
std::string cooked_context;
@@ -1469,11 +1469,6 @@ int rgw_s3_prepare_decrypt(req_state* s, optional_yield y,
14691469

14701470
/* SSE-S3 */
14711471
if (stored_mode == "AES256") {
1472-
if (s->cct->_conf->rgw_crypt_require_ssl &&
1473-
!rgw_transport_is_secure(s->cct, *s->info.env)) {
1474-
ldpp_dout(s, 5) << "ERROR: Insecure request, rgw_crypt_require_ssl is set" << dendl;
1475-
return -ERR_INVALID_REQUEST;
1476-
}
14771472
/* try to retrieve actual key */
14781473
std::string key_id = get_str_attribute(attrs, RGW_ATTR_CRYPT_KEYID);
14791474
std::string actual_key;

0 commit comments

Comments
 (0)