mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
https://mailinabox.email/
Creative Commons Zero v1.0 Universal
14.03k stars 1.44k forks source link

https certificate has wrong "common name" v0.29 #1517

Open mklilley opened 5 years ago

mklilley commented 5 years ago

Hi,

Thanks for taking time to make Mail-in-a-box, I love it!

I'm currently running v.0.29 and noticed something strange with an https certificate for a static website that's being served via the box.

If you go to https://smartpeople.courses/ and look at the valid certificate the common name is actually lunamontes.com (another static site that I own). When I look deeper into the certificate I see smartpeople.courses referenced in the extension section.

When you go to another site that I made very recently https://projectfusion.tech/ you'll find the certificate has the correct common name.

I am a bit confused. I made smartpeople.courses after lunamontes.com but both were made over a year ago.

Any thoughts?

Thanks,

Matt

alento-group commented 5 years ago

Are they both being served from the /default directory? I suspect that a certificate was originally requested for both domains at the same time, and since they shared the same document root, LE would have issued them as SANs. The third domain being added recently would explain why it is not included on the same certificate.

mklilley commented 5 years ago

Thanks @alento-group

They are not in default, but tbh when I was setting things up I was moving directories around so who knows what really happened.

From a practical point of view, is this something that can be fixed?

Matt

nomandera commented 5 years ago

I am going to guess lunamontes.com is the default TLD you setup MIAB with. This combined with https://github.com/mail-in-a-box/mailinabox/issues/690 maybe accounts for what you are seeing?

tl;dr you are prob used to seeing a cert per domain but MIAB generates one cert per server with alt names for every domain you host (ceveat I am using 0.30 still so I am not fully up to date how it works today)

mklilley commented 5 years ago

Thanks @anoma