

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 适用于 RabbitMQ 的亚马逊 MQ 的 HTTP 身份验证和授权
<a name="http-for-amq-for-rabbitmq"></a>

适用于 RabbitMQ 的 Amazon MQ 支持使用外部 HTTP 服务器对代理用户进行身份验证和授权。有关其他支持的方法，请参阅适用于 [RabbitMQ 代理的 Amazon MQ 身份验证和授权](rabbitmq-authentication.md)。

**注意**  
HTTP 身份验证插件仅适用于适用于 RabbitMQ 版本 4 及更高版本的亚马逊 MQ。

**重要注意事项**  
HTTP 服务器需要可通过公共互联网访问。适用于 RabbitMQ 的 Amazon MQ 可以配置为使用双向 TLS 向 HTTP 服务器进行身份验证。
适用于 RabbitMQ 的 Amazon MQ 强制使用需要访问本地文件系统的设置。 AWS ARNs 有关更多详细信息，请参阅 [RabbitMQ 配置中的 ARN 支持](arn-support-rabbitmq-configuration.md)。
您必须包含 IAM 权限`mq:UpdateBrokerAccessConfiguration`，才能对现有代理启用 HTTP 身份验证。
Amazon MQ 会自动创建一个名为 `monitoring-AWS-OWNED-DO-NOT-DELETE` 的系统用户，该用户仅具有监控权限。即使在支持 HTTP 的代理上，该用户也使用 RabbitMQ 的内部身份验证系统，并且只能访问环回接口。Amazon MQ 通过添加[受保护的用户标签来防止删除该用户](https://github.com/rabbitmq/rabbitmq-server/blob/3751301d5a851f3f0a7d0b15583e52cb81af4e6b/release-notes/4.2.0.md#enhancements-3)。

有关如何为您的 Amazon MQ for RabbitMQ 代理配置 HTTP 身份验证的信息，请参阅。[使用 HTTP 身份验证和授权](rabbitmq-http-tutorial.md)

**Topics**
+ [支持的 HTTP 配置](#http-supported-configs)
+ [亚马逊 MQ 中 HTTP 配置的其他验证](#http-additional-validations)

## 支持的 HTTP 配置
<a name="http-supported-configs"></a>

适用于 RabbitMQ 的 Amazon MQ 支持 Rabb [itMQ HTTP 身份验证插件](https://github.com/rabbitmq/rabbitmq-auth-backend-http)中的所有可配置变量，但以下需要的例外情况除外。 AWS ARNs有关 ARN 支持的详细信息，请参阅 RabbitMQ 配置中的 [ARN 支持。](arn-support-rabbitmq-configuration.md)

### 需要的配置 ARNs
<a name="http-arn-required-configs"></a>

`auth_http.ssl_options.cacertfile`  
请改用 `aws.arns.auth_http.ssl_options.cacertfile`

`auth_http.ssl_options.certfile`  
请改用 `aws.arns.auth_http.ssl_options.certfile`

`auth_http.ssl_options.keyfile`  
请改用 `aws.arns.auth_http.ssl_options.keyfile`

### 不支持的 SSL 选项
<a name="http-unsupported-ssl-options"></a>

也不支持以下 SSL 配置选项：

#### 查看完整清单
<a name="http-ssl-options-list-content"></a>
+ `auth_http.ssl_options.cert`
+ `auth_http.ssl_options.client_renegotiation`
+ `auth_http.ssl_options.dh`
+ `auth_http.ssl_options.dhfile`
+ `auth_http.ssl_options.honor_cipher_order`
+ `auth_http.ssl_options.honor_ecc_order`
+ `auth_http.ssl_options.key.RSAPrivateKey`
+ `auth_http.ssl_options.key.DSAPrivateKey`
+ `auth_http.ssl_options.key.PrivateKeyInfo`
+ `auth_http.ssl_options.log_alert`
+ `auth_http.ssl_options.password`
+ `auth_http.ssl_options.psk_identity`
+ `auth_http.ssl_options.reuse_sessions`
+ `auth_http.ssl_options.secure_renegotiate`
+ `auth_http.ssl_options.versions.$version`
+ `auth_http.ssl_options.sni`
+ `auth_http.ssl_options.crl_check`

## 亚马逊 MQ 中 HTTP 配置的其他验证
<a name="http-additional-validations"></a>

Amazon MQ 还对 HTTP 身份验证和授权强制执行以下额外验证：
+ `auth_http.http_method`必须是`get`或 `post`
+ 以下路径配置必须使用 HTTPS URLs：
  + `auth_http.user_path`
  + `auth_http.vhost_path`
  + `auth_http.resource_path`
  + `auth_http.topic_path`
+ 如果有任何设置需要使用 AWS ARN，则`aws.arns.assume_role_arn`必须提供。