Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate multiple certs for single nginx container #57

Closed
sandrodz opened this issue May 2, 2016 · 30 comments
Closed

generate multiple certs for single nginx container #57

sandrodz opened this issue May 2, 2016 · 30 comments

Comments

@sandrodz
Copy link

sandrodz commented May 2, 2016

is it possible to generate multiple certificates like:

  • VIRTUAL_HOST: domain1.com,domain2.com,domain3.com
  • LETSENCRYPT_HOST: domain1.com,domain2.com,domain3.com

I've single nginx server behind nginx-proxy. I don't want to have separate nginx server for each domain.

this companion doesn't generate ssl for all mentioned domains: domain1.com,domain2.com,domain3.com

@JrCs
Copy link
Collaborator

JrCs commented May 3, 2016

Yes it must work as you describe.
If not can you post the logs ?

@sandrodz
Copy link
Author

sandrodz commented May 9, 2016

Hi, sorry it took me a while to play with all possible combinations, hence the belated reply.

But I don't seem to understand the logic. Sometimes specific ssl is generated for domain, sometimes same one is used for several domains... I cannot really comprehend the logic behind these.

screen shot 2016-05-09 at 6 46 34 pm
screen shot 2016-05-09 at 6 47 03 pm
screen shot 2016-05-09 at 7 06 04 pm

@JrCs
Copy link
Collaborator

JrCs commented May 9, 2016

All seems ok except wiseadvices.com. Perhaps you create it before grouping all domains. So remove wiseadvices.com directory and relaunch the companion.

@sandrodz
Copy link
Author

sandrodz commented May 9, 2016

so:

adjara -> adjara
cdn -> adjara
demos -> adjara
njord -> njord
shop -> shop
wise -> wise

both shop and njord are in the group too, but they have their own certs?

and is it possible to have main one not adjara but something else instead?

@sandrodz
Copy link
Author

sandrodz commented May 9, 2016

I deleted old certs dir and let it recreate. and I see this:

screen shot 2016-05-09 at 9 11 26 pm

I don't see how it is normal to group unrelated domains. grouping sub-domains make sense, but this is not what I see.

what worries me is this though:

screen shot 2016-05-09 at 9 13 37 pm

can I show a diff domain there? Like we are de's as common name, instead of adjara.

@JrCs
Copy link
Collaborator

JrCs commented May 10, 2016

The "main" domain is the first domain set in LETSENCRYPT_HOST variable

@sandrodz
Copy link
Author

yeah I got that :) also symbolic links make sense. But why is that domain displayed in ssl overview? common name should be we are.de not adjara right?

@JrCs
Copy link
Collaborator

JrCs commented May 10, 2016

Because it's the "main" domain. Open certificat details to see other domain that are in the certificat:
screenshot

@sandrodz
Copy link
Author

we are de is the first in LETSENCRYPT_HOST variable, you can also see that symbolic links point to we are de not adjara. So how come adjara is the main?

@sandrodz
Copy link
Author

screen shot 2016-05-10 at 3 03 22 pm

@JrCs
Copy link
Collaborator

JrCs commented May 10, 2016

Remove all certs and restart companion.

@sandrodz
Copy link
Author

result is same, could it be alphabetic?

@JrCs
Copy link
Collaborator

JrCs commented May 10, 2016

No, it's the first one i'm sure.
Try to declare one cert by one cert in LESTENCRYPT_HOST and see if it works

@sandrodz
Copy link
Author

hang on 5mins I'll make a video

@JrCs
Copy link
Collaborator

JrCs commented May 10, 2016

You must see this message in the logs:

Creating/renewal $base_domain certificates...

Where $base_domain is your first host of LETSENCRYPT_HOST variable

@sandrodz
Copy link
Author

sandrodz commented May 10, 2016

Here you go, contains log messages also.

http://sendvid.com/x1s0eboq

@JrCs
Copy link
Collaborator

JrCs commented May 10, 2016

Sorry i can't acces to the video at the moment. Check if the message in the logs is right.

@sandrodz
Copy link
Author

its correct
screen shot 2016-05-10 at 3 38 05 pm

@JrCs
Copy link
Collaborator

JrCs commented May 10, 2016

So all certs must point to the weare.de.com directory ?

@sandrodz
Copy link
Author

sandrodz commented May 10, 2016

yes all of them point to weare.de.com dir like on screenshots.

problem is common name that certificate displays on all pages, which is adjaragroup.

this:

687474703a2f2f7075752e73682f6f4d4652392f336631363634663537382e706e67

shouldn't it be we are de?

@JrCs
Copy link
Collaborator

JrCs commented May 10, 2016

Check that a new certificat has been created (check details in certificate about creation date).
You can try also to remove adjaragroup from LETSENCRYPT_HOST and in the certs directory and restart the companion. If a new certificat is created you must not see adjaragroup in the common name.

@JrCs
Copy link
Collaborator

JrCs commented May 10, 2016

It seems that simp_le create SAN with domain sort alphabetically. So the common name will be adjaragroup. But it's doesn't care because your certificat is valid for all alternate domains.

@sandrodz
Copy link
Author

So your saying even if I remove adjara, I will get common name next in the alphabetic order that is cdn ?

@JrCs
Copy link
Collaborator

JrCs commented May 10, 2016

Yes i think.

@sandrodz
Copy link
Author

@sandrodz
Copy link
Author

after searching and reading everything this seems to be the root issue: certbot/certbot#2798

so since v 0.5 this bug was introduced in letsencrypt client. 0.6 version includes the fix.

At what version is your docker container?

@JrCs
Copy link
Collaborator

JrCs commented May 11, 2016

The companion container doesn't use the letsencrypt client but simp_le.
There seem an issue open for that: kuba/simp_le#72

@sandrodz
Copy link
Author

I see, and there is PR that changes things: kuba/simp_le#105

@sandrodz
Copy link
Author

btw, my workaround: I added subdomain abc.main.domain to get it to be the common name.

@JrCs
Copy link
Collaborator

JrCs commented May 12, 2016

Good !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants