Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Move juju/cert pkg into utils. #250
Conversation
hoenirvili
referenced this pull request
in juju/juju
Nov 10, 2016
Merged
Make all juju/cert paths point now to utils/cert #6556
| + | ||
| +// Verify verifies that the given server certificate is valid with | ||
| +// respect to the given CA certificate at the given time. | ||
| +func Verify(srvCertPEM, caCertPEM string, when time.Time) error { |
axw
Nov 10, 2016
Member
unless this is needed by winrm, I think we should leave this one in juju/cert. It has some juju-specifics, because of the "anyServer".
hoenirvili
Nov 10, 2016
Contributor
This is not needed for winrm, winrm itself has built it function to verify the cert.
| + | ||
| +// NewCA generates a CA certificate/key pair suitable for signing server | ||
| +// keys for an environment with the given name. | ||
| +func NewCA(envName, UUID string, expiry time.Time) (certPEM, keyPEM string, err error) { |
axw
Nov 10, 2016
Member
Since this is meant to be generic, I think we should just pass in the common name and use it directly in the CommonName field. juju/cert can then have its own NewCA function which calls the one in this package with fmt.Sprintf(...)
| +} | ||
| + | ||
| +// newLeaf generates a certificate/key pair suitable for use by a leaf node. | ||
| +func newLeaf(caCertPEM, caKeyPEM string, expiry time.Time, hostnames []string, extKeyUsage []x509.ExtKeyUsage) (certPEM, keyPEM string, err error) { |
axw
Nov 10, 2016
Member
as above, I think this should take CommonName as an arg, and juju/cert can have its own version that passes in "*"
| + return n, nil | ||
| +} | ||
| + | ||
| +// NewDefaultServer generates a certificate/key pair suitable for use by a server, with an |
axw
Nov 10, 2016
Member
can we just keep these two functions (NewDefaultServer and NewServer) in juju/cert, and expose newLeaf (NewLeaf)?
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-utils |
hoenirvili commentedNov 10, 2016
•
Edited 1 time
-
hoenirvili
Nov 10, 2016
As discussed in here #249
@axw @dooferlad