From edd9cfce3fd78bac6172853c00538b7aeab88a2c Mon Sep 17 00:00:00 2001 From: David Dollar Date: Sun, 31 Jul 2016 22:28:16 -0400 Subject: [PATCH] randomize the cert name --- api/models/release.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/models/release.go b/api/models/release.go index 62978391c2..54d0b26a0a 100644 --- a/api/models/release.go +++ b/api/models/release.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "html/template" + "math/rand" "os" "os/exec" "regexp" @@ -271,7 +272,7 @@ func (r *Release) Promote() error { switch app.Parameters[protoParam] { case "https", "tls": if app.Parameters[certParam] == "" { - name := fmt.Sprintf("cert-%s-%d", os.Getenv("RACK"), time.Now().Unix()) + name := fmt.Sprintf("cert-%s-%d-%05d", os.Getenv("RACK"), time.Now().Unix(), rand.Intn(100000)) body, key, err := GenerateSelfSignedCertificate("*.*.elb.amazonaws.com") if err != nil {