Autodiscover CNAME

RenardRobert-6157 6 Reputation points
2022-01-31T11:00:18.693+00:00

Hello,

I want to better understand the autodiscover process when using a CNAME. I have some assumptions, but are they correct?

First scenario:
-autodiscover.mydomain.com is a CNAME and points to autodiscover.subdomain.mydomain.com (reverse proxy with certificate)
-The certificate must have autodisciver.mydomain.com as the subject name, right? Because this is the address which is requested. The autodiscover.subdomain.mydomain.com doesn't have to be included in the certificate?!

So the flow would be: Outlook queries autodiscover.mydomain.com and gets the IP address of autodiscover.subdomain.mydomain.com. Outlook connects to this IP and gets the certificate for autodiscover.mydomain.com and can post the request.

Second scenario:
-autodiscover.mydomain.com is a CNAME and points to autodiscover.outlook.com
-The certificate will not have any of my autodiscover names included.

Here, the process would be: Outlook queries autodiscover.mydomain.com and gets the IP address of autodiscover.outlook.com. Because port 443 is not listening there, outlook checks for redirect options and is redirected to autodiscover-s.outlook.com. Because this is a redirect, the requestet hostname now is autodiscover-s.outlook.com and the certificate name only must match this address.

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,369 questions
{count} votes

7 answers

Sort by: Most helpful
  1. RenardRobert-6157 6 Reputation points
    2022-01-31T18:59:02.067+00:00

    I think we're running in a misunderstanding again.

    Let me explain again what I mean:

    Let's assume, I've excluded the ExplicitO365Endpoint for Outlook autodiscover. My autodiscover record is a CNAME that points to autodiscover.outlook.com. My mailbox has already been migrated to Exchange Online. I will now try to add my mailbox in Outlook from an external device. Outlook will try to contact autodiscover.mydomain.com. Because this is a CNAME pointing to autodiscover.outlook.com, it will contact this host. Based on our discussion, this would lead to a certificate error, because autodiscover.mydomain.com is not listed as a subject (alternate) name on Microsoft's certificates.

    I checked, that autodiscover.outlook.com is not accessible via HTTPS/443. Because Outlook cannot contact the autodiscover service via HTTPS, it falls back to the HTTP redirect method on HTTP/80. From there, it gets a HTTP 302 redirect to something like autodiscover-s.outlook.com. Outlook will then try to contact this URL via HTTPS/443 and because this is a "real" redirect (no CNAME), Outlook will validate, that autodiscover-s.outlook.com is present on the certificate. The initial autodiscover.mydomain.com doesn't even matter, because the request was redirected. Outlook normally would then present a warning that the autodiscover URL has been redirected and prompts the user to accept this redirection.

    25486-image.png

    Because of the registry key "RedirectServers", this message will never be shown, because these servers are already somehow "accepted" to be redirected to.

    1394355

    1 person found this answer helpful.

  2. Andy David - MVP 142.3K Reputation points MVP
    2022-01-31T12:35:01.993+00:00

    If autodiscover.subdomain.mydomain.com is what the cname is pointing to, then autodiscover.subdomain.mydomain.com has to be subject name ( or a widlcard) on the cert the client connects to that represents that FQDN.

    in your second scenario, Microsoft has a cert with that subject name ( or wildcard in this case) set to that endpoint

    169921-image.png

    0 comments No comments

  3. RenardRobert-6157 6 Reputation points
    2022-01-31T14:51:44.007+00:00

    Okay thanks, I always thought that a CNAME will only tell the client the IP address of the target system by maintaining the original name.

    E.g., domain.com CNAME points do domain2.com - client would try to connect to domain.com and gets the IP address of domain2.com and therefore, domain.com must be in the SSL certificate because that's the original name to connect to.


  4. Andy David - MVP 142.3K Reputation points MVP
    2022-01-31T17:55:22.307+00:00

    Ok, sorry if I wasnt clear. I was focused on the what the CNAME was pointing to - ensuring that subject name is on the cert. In these scenarios, you def want all the possible name(s) on the cert or use a wildcard including the CNAME and the what the CNAME is pointing to.- if you control it of course. othrwise, if your autodiscover is pointing at Mcirosoft, then all you need is the initial CNAME on your cert, it gets resolved to 365 outlook and they own that cert.
    Sorry, if that wasnt clear.

    0 comments No comments

  5. RenardRobert-6157 6 Reputation points
    2022-01-31T18:01:40.907+00:00

    Maybe I also didn't explain well. But thanks, now I understand. So just to come back to my first post regarding the more special autodiscover scenario: because Microsoft won't have the customers autodiscover names on their certificate, how does this work?

    Is this due to the HTTP redirect (because port 443 is not listening on autodiscover.outlook.com)? Because some Microsoft autodiscover URLs are also ncluded under the "redirect servers" in Windows registry.

    0 comments No comments