简体   繁体   English

无法将子域用于Azure API管理

[英]Unable to use a sub domain for Azure API Management

Is it possible to use more than one level of sub domain when creating a CNAME for Azure API Management? 为Azure API管理创建CNAME时可以使用多个级别的子域吗?

I have a domain set up in Azure as follows; 我在Azure中设置了一个域,如下所示;

mydomain.com        <- main web site as an Azure web app
api.mydomain.com    <- API managed by Azure API Mgmt
portal.mydomain.com <- Portal managed by Azure API Mgmt

This works fine, but we'd like to set up a structured test sub domain as follows; 这可以正常工作,但我们希望按如下所示设置结构化的测试子域;

test.mydomain.com        <- main web site as an Azure web app
api.test.mydomain.com    <- API managed by Azure API Mgmt
portal.test.mydomain.com <- Portal managed by Azure API Mgmt

We have created the test.mydomain.com web app fine, but Azure API Management will not let us use the sub domain api.test or portal.test. 我们已经很好地创建了test.mydomain.com Web应用程序,但是Azure API Management不允许我们使用子域api.test或portal.test。

The error it generates is; 它产生的错误是:

{"code":"InvalidOperation","message":"Certificate '933EDADD0C4037F6A0C02D38DFD5AF4A76FXXXXX' is invalid. Domain name: api.test.mydomain.com","details":null,"innerError":null} {“代码”:“ InvalidOperation”,“消息”:“证书'933EDADD0C4037F6A0C02D38DFD5AF4A76FXXXXX'无效。域名:api.test.mydomain.com”,“详细信息”:null,“ innerError”:null}

This goes away if we use a single host (for example, apitest without the dot instead of api.test). 如果我们使用单个主机(例如,不带点号的apitest而不是api.test),这将消失。

Our CNAMES are set up as follows. 我们的CNAMES设置如下。

api mydomainapi.azure-api.net
api.test mydomaintestapi.azure-api.net
portal.test mydomaintestapi.azure-api.net

I've tried all kinds of jiggery pokery with the awverify abominations and we have been able to host web apps using those custom domains, just not Azure API endpoints. 我已经尝试过各种令人讨厌的技术,并且我们能够使用那些自定义域来托管Web应用程序,而不仅仅是Azure API终结点。

Looks like you are trying to use SSL certificate with subject name *.mydomain.com? 看起来您正在尝试使用主题名称为* .mydomain.com的SSL证书? If yes, then the error is expected as SSL wildcard certificate for *.mydomain.com will match apitest.mydomain.com but will not match api.test.mydomain.com. 如果是,则错误预期为* .mydomain.com的SSL通配符证书将匹配apitest.mydomain.com,但不匹配api.test.mydomain.com。 This is nothing to do with APIM specifically, this is how cert subject name matching rules are defined/implemented. 这与APIM无关,这是定义/实施证书主体名称匹配规则的方式。

Here is one explanation regarding the same wildcard ssl on sub-subdomain 这是关于子子域上相同通配符ssl的一种解释

You can either get new certificate or add *.test.mydomain.com in SAN for the same certificate then same SSL cert will work for all 3 of your urls. 您可以获取新证书,也可以在SAN中为同一证书添加* .test.mydomain.com,然后相同的SSL证书将对您的所有3个网址起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM