I request a cert for domain3.com but browsers report that the cert is for domain2.com.
I host multiple domains from an Apache server with many virtual hosts.
The default domain is mycompany.com, and my clients are domain1.com, domain2.com etc. (fake names).
So all of them work fine except domain3.com that receives a cert for domain2.com.
I verified all scripts involved in the generation and deployment but could not find any differences in them other than literal domain names. I do not know when it started, but the owner contends that it worked until the last renewal late last year.
The last I have touched the vhost file was during the server migration about 1 year ago. Everything was verified and found to be working by myself and all domain owners. It's worked fine for about 1 year, and now this 1 vhost out almost a dozen has the mixed up cert. In the mean time no one touched the vhosts or the scheduled task or their scripts.
What's the purpose of this test? I know which certs are being served.
domain3.crt and domain3.key are served from domain3, but their contents show domain2.com. What is your test going to clarify?
All of them point to the same IP address, and Apache handles domains by way of vhosts, like I wrote in the OP. So DNS is not the suspect here.
Of course it does. It is granted. The file domain3.crt and domain3.key contain wrong information in them. They are copied from C:\Certbot\Live\domain3.com\ So, where do I begin to look for the problem?
What specifically should I look for in its output? I cannot find anything that could point at problems. Everything looks correct.
I'm out of time. We're mostly volunteers here. Certs are just files. Nothing magical.
An experienced set of eyes could help you but without details it's just impractical. At least for me. Maybe someone else will be able to help. Good luck.
Thanks for investigating me! But you are confusing things that "are" with things that "would be". Since I did not get answers that I was hoping for, the migration never happened.
The two most important pieces to your solution are:
Listing the certificates managed by your ACME client.
[don't know which you used]
If certbot, show: certbot certificates
If other, check their documentation.
The final piece is the script that copies those certificate files around.
With all those pieces, the puzzle will become clear.