@@ -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