这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@michaelshobbs
Copy link
Member

TODOS:

  • remove 'magically' added VHOST entries based on SSL cert information
  • implement certs plugin 'loosely' based on https://devcenter.heroku.com/articles/ssl-endpoint
    • only implements certs:remove, certs:info and certs:generate (if someone wants to take a stab at the others, please feel free)
  • document certs plugin
  • document private/shared functions convention for plugins

Note:

  • further implements cross-plugin function sharing. as a convention, we've seem to have settled on shareable functions residing in <plugin_path>/functions and non-shareable functions residing in <plugin_path>/commands (example here)

closes #1368

example certs:info output

root@dokku:~/dokku# dokku certs:info node-js-app
-----> Fetching SSL Endpoint info for node-js-app...
-----> Certificate details:
=====> Common Name(s):
=====>    test.dokku.me
=====>    www.test.dokku.me
=====>    www.test.app.dokku.me
=====> Expires At: Jan 14 17:57:12 2017 GMT
=====> Issuer: C=US, ST=California, L=San Francisco, OU=Dokku Me, LLC, CN=test.dokku.me
=====> Starts At: Jan 15 17:57:12 2015 GMT
=====> Subject: C=US; ST=California; L=San Francisco; OU=Dokku Me, LLC; CN=test.dokku.me
=====> SSL certificate is self signed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working on implementation now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the docs as well to illustrate how this will work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure. I meant to add a task to redo the entirety of the docs for this; including the "public functions convention.

@michaelshobbs michaelshobbs force-pushed the 1368_mh-certs-plugin branch 2 times, most recently from 509e0ce to e01890f Compare August 25, 2015 02:32
@josegonzalez
Copy link
Member

Output of certs:info:

jose@mactaku:~/Apps/seatgeek/app git:master $ heroku certs:info
Fetching SSL Endpoint some-endpoint.herokussl.com info for app... done
Certificate details:
Common Name(s): *.domain.com
                domain.com

Expires At:     2019-03-15 05:45 UTC
Issuer:         ISSUER_DATA
Starts At:      2014-12-21 21:24 UTC
Subject:        SUBJECT_DATA
SSL certificate is verified by a root authority.

@michaelshobbs michaelshobbs changed the title [WIP] certs plugin certs plugin Aug 25, 2015
@michaelshobbs
Copy link
Member Author

@josegonzalez this is ready to be banged on. review away

@josegonzalez
Copy link
Member

GTFO tests fail.

Let me see what I can do to test it. I have a wildcard cert somewhere...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelshobbs I think you ran git cherry-pick in the wrong branch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i rebased master

@josegonzalez
Copy link
Member

So is the expectation that people only be able to use self-signed certs with this plugin?

@michaelshobbs
Copy link
Member Author

No. See docs for the generate command. We place the SS cert in place and then you can replace it when you get your real cert back if you decide to go that route.

@josegonzalez
Copy link
Member

How does someone replace the cert?

@michaelshobbs
Copy link
Member Author

RTFM man!! 😄

from the new docs

If you decide to obtain a CA signed certficate, simply place it in 
`$DOKKU_ROOT/$APP/tls/server.crt` and run `dokku nginx:build-config $APP`.

@josegonzalez
Copy link
Member

I mean shouldn't we remove the nginx version of adding certs then? Seems like that's unnecessary duplication.

@michaelshobbs
Copy link
Member Author

so that's a way to import a cert. which doesn't follow the heroku certs ui. hence i didn't use. that's a benefit of using something like ruby (?) for the client. not sure how to pipe in a key and cert file via an ssh connection

@josegonzalez
Copy link
Member

Lets assume that we don't have to support ssh. Would it then be fine to include that functionality in here and rip it out of the old place?

@michaelshobbs
Copy link
Member Author

sure. the current implementation is a bit hokey. would you want to implement the same heroku ui?

i.e.:

certs:add CRT KEY            #  Add an ssl endpoint to an app.

@josegonzalez
Copy link
Member

Yeah, I think so?

@josegonzalez
Copy link
Member

Okay, I:

  • rebased the pr, wooter scooter!
  • moved the existing nginx:import-ssl command to certs:add.
  • updated the ssl docs to be much more comprehensive.
  • removed old docs in the nginx.md file.

How do you set multiple ssl certs? I don't think thats possible at all, despite what the docs said. Can someone verify that to be the case? I don't see how, given that we hardcode the location of server.crt and server.key. Personally I am okay with this, but we need to be very clear about this.

@michaelshobbs
Copy link
Member Author

Multiple certs were never supported

@josegonzalez
Copy link
Member

The following heroku commands are left unimplemented:

certs:chain CRT [CRT ...], Print the ordered and complete chain for the given certificate.
certs:key CRT KEY [KEY ...], Print the correct key for the given certificate.
certs:rollback, Rollback an SSL Endpoint for an app.
certs:update CRT KEY, Update an SSL Endpoint on an app.

The rollback one isn't worth attempting to implement, and I think certs:update can be used as an alias for certs:add in our case. What do you think of the other two?

This can be used as an alternative to importing via stdin, which may be preferred when working directly on a server, or via scripted installation/deployments.
If a command will exit because of invalid input, that isn't a warning, it's a failure.
@josegonzalez
Copy link
Member

I've implemented crt/key importing via files on disk vs tarball. I think if tests pass, we can safely merge this in, as I have no intention of implementing any of the others (and they can be implemented in the future if need be).

Thoughts (before you head off to the wilderness)?

@michaelshobbs
Copy link
Member Author

Works for me. key and chain didn't make sense to me as i wasn't sure how to implement with openssl. if someone else wants to take a stab, go for it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll want a space here between $KEY_FILE and ]] 😄

@josegonzalez
Copy link
Member

Merging!

josegonzalez added a commit that referenced this pull request Sep 4, 2015
@josegonzalez josegonzalez merged commit 7a1c080 into master Sep 4, 2015
@josegonzalez josegonzalez deleted the 1368_mh-certs-plugin branch September 4, 2015 17:26
@josegonzalez josegonzalez changed the title certs plugin Add certs plugin for certificate management Sep 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don’t automatically configure certificate’s CN and SANs as domains

4 participants