跳至內容

create API mappings error: "To map an HTTP API, change the security policy to TLS 1.0 or TLS 1.2”

0

This week, I created a new public regional custom domain name for my API gateway with security policy SecurityPolicy_TLS13_1_2_2021_06. When I try to add API mapping for my HTTP API Gateway prod stage, I get the error “You can only map REST APIs to this custom domain name. To map an HTTP API, change the security policy to TLS 1.0 or TLS 1.2.” But in the security policy list, the only available security policies are TLS 1.3 (Specifically, the only security policies it's letting me choose from are TLS13_1_2_2021_06, TLS13_1_3_2025_09, TLS13_1_3_FIPS_2025_09, TLS13_1_2_PQ_2025_09, TLS13_1_2_PFS_PQ_2025_09, TLS13_1_2_FIPS_PQ_2025_09, AND TLS13_1_2_FIPS_PFS_PQ_2025_09.)

All the TLS 1.2 policies are greyed out, so how can I add my API mapping? My API gateway is definitely an HTTP API. Was there a recent change in the security policy listing in AWS console for custom domains? I tried working around this, as suggested by ChatGPT, by updating the security policy to TLS_1_2 using the AWS CLI, but it did not work (no error but also didn't change anything).

Re:Post AI claims, “TLS 1.2 is the minimum required version for most AWS services with custom domains and will continue to be supported. There are no announcements indicating TLS 1.2 deprecation. [1] [2] [3]”
And yet, as I’ve shown, TLS 1.2 is no longer available.

已提問 2 個月前檢視次數 113 次

3 個答案
2
已接受的答案

To add to Sandhya's observation regarding the console UI behavior: the reason your AWS CLI workaround failed silently is due to an API Gateway backend requirement regarding the endpointAccessMode parameter.

When downgrading a custom domain's security policy from any newer SecurityPolicy_* format back to the legacy TLS_1_2 policy, the API requires you to explicitly unset the endpointAccessMode. If you only pass the securityPolicy modification in your patch operations, the API silently ignores the request. You can bypass the console UI restrictions and fix the existing domain directly by applying both patch operations simultaneously:


aws apigateway update-domain-name \
  --domain-name YOUR_CUSTOM_DOMAIN_NAME \
  --patch-operations '[{"op":"replace","path":"/securityPolicy","value":"TLS_1_2"},{"op":"replace","path":"/endpointAccessMode","value":""}]'

Once this update is applied, API Gateway will accept the HTTP API mapping.

專家

已回答 2 個月前

  • Thank you, Florian, your trick worked and I am now able to add my API mappings. Thank you!

2
  • HTTP API Protocol Limitation: AWS HTTP APIs do not support TLS 1.3 security policies for custom domains. They strictly require a TLS 1.0 or TLS 1.2 security policy to function.

  • Immutability of TLS 1.3 Domains: Once an API Gateway custom domain name is created using a TLS 1.3 security policy, AWS does not allow it to be downgraded to TLS 1.2 or TLS 1.0. Because you initialized the domain with SecurityPolicy_TLS13_1_2_2021_06, the TLS 1.2 options are permanently greyed out for that specific resource, and the AWS CLI modification command is silently ignored.

To resolve this and successfully map your HTTP API, you must recreate the custom domain resource:

  • Delete the current custom domain name from API Gateway.

  • Create a new custom domain name using the exact same domain string.

  • During the creation process, select a TLS 1.2 security policy (such as SecurityPolicy_TLS_1_2_2021_01) right from the start.

  • Once the new domain is active, add your API mapping for the HTTP API prod stage. It will link without errors.

Official Reference

專家

已回答 2 個月前

  • Thanks for looking into this, Florian. I tried this - I deleted my custom domain name and started a new one from scratch, but got the same results. To be specific, this is what I'm doing in the AWS console: API Gateway > Custom domain names > Add domain name Enter my domain name Leave the defaults: Public, API mappings only, Regional, IPv4, choose Security Policy. I am still seeing the same TLS choices (all SecurityPolicy_TLS13*). At the top it shows TLS_1_2 greyed out with the description "This is a legacy policy. Use a policy that starts with "SecurityPolicy". But under the TLS_1_2 heading, there is one marked SecurityPolicy_TLS13_1_2_2021_06 (has comment "Requires a minimum of TLS 1.2"). So I gave it a try since it was different from the one I tried last time, hoping the comment meant it was compatible with 1.2. Selected my certificate. Click "Add domain name" Configure API mappings Add new mapping Choose my API and stage prod, path empty Click Save Error: You can only map REST APIs to this custom domain name. To map an HTTP API, change the security policy to TLS 1.0 or TLS 1.2. TLS 1.2 policies are all greyed out; the only available policies under TLS 1.3.

0

Hi, Ken: I tried to replicate your issue in my AWS environment, with HTTP API and custom domain.

First, I created the custom domain with the SecurityPolicy_TLS13_1_2_2021_06, I was able to created the domain successfully, but I could not add the HTTP API with this domain. Then, I update the Security Policy with TLS1.2 and then added the HTTP API, and it worked. Again, to cross check, I tried to update the Security Policy back to TLS13_1_2_2021_06, it gave me this error. Currently, the security policy can not be updated when WebSocket or HTTP APIs are associated to the domain name. TLS 1.2 is the only permitted security for this security policy for these API types.

It's also mentioned on the provided document: API Gateway supports security policies on all APIs. However, you can only choose a security policy for REST APIs. API Gateway only supports the TLS_1_2 security policy for HTTP or WebSocket APIs.

已回答 2 個月前

專家

已審閱 2 個月前

  • Thank you for trying this, but unfortunately TLS 1.2 is unavailable to me in the security policy dropdown - everything lower than TLS_13 is commented out, either on initial creation or on update.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。