mirror of https://github.com/docker/docs.git
use server and username for certificate subject and issuer
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
aae6f74f84
commit
d48c0f4157
3
host.go
3
host.go
|
|
@ -117,7 +117,8 @@ func (h *Host) ConfigureAuth() error {
|
||||||
caKeyPath := filepath.Join(utils.GetMachineDir(), "key.pem")
|
caKeyPath := filepath.Join(utils.GetMachineDir(), "key.pem")
|
||||||
serverCertPath := filepath.Join(h.storePath, "server.pem")
|
serverCertPath := filepath.Join(h.storePath, "server.pem")
|
||||||
serverKeyPath := filepath.Join(h.storePath, "server-key.pem")
|
serverKeyPath := filepath.Join(h.storePath, "server-key.pem")
|
||||||
org := "docker"
|
|
||||||
|
org := h.Name
|
||||||
bits := 2048
|
bits := 2048
|
||||||
|
|
||||||
log.Debugf("generating server cert: %s", serverCertPath)
|
log.Debugf("generating server cert: %s", serverCertPath)
|
||||||
|
|
|
||||||
6
main.go
6
main.go
|
|
@ -16,7 +16,11 @@ func before(c *cli.Context) error {
|
||||||
caKeyPath := c.GlobalString("tls-ca-key")
|
caKeyPath := c.GlobalString("tls-ca-key")
|
||||||
clientCertPath := c.GlobalString("tls-client-cert")
|
clientCertPath := c.GlobalString("tls-client-cert")
|
||||||
clientKeyPath := c.GlobalString("tls-client-key")
|
clientKeyPath := c.GlobalString("tls-client-key")
|
||||||
org := "docker"
|
|
||||||
|
org, err := utils.GetUsername()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
bits := 2048
|
bits := 2048
|
||||||
|
|
||||||
if _, err := os.Stat(utils.GetMachineDir()); err != nil {
|
if _, err := os.Stat(utils.GetMachineDir()); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package utils
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"os/user"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
@ -26,6 +27,15 @@ func GetMachineClientCertDir() string {
|
||||||
return filepath.Join(GetMachineDir(), ".client")
|
return filepath.Join(GetMachineDir(), ".client")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetUsername() (string, error) {
|
||||||
|
u, err := user.Current()
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return u.Username, nil
|
||||||
|
}
|
||||||
|
|
||||||
func CopyFile(src, dst string) error {
|
func CopyFile(src, dst string) error {
|
||||||
in, err := os.Open(src)
|
in, err := os.Open(src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue