Skip to content

Commit

Permalink
Merge pull request #9 from nginxinc/newline-between-key-and-cert
Browse files Browse the repository at this point in the history
Added a newline for a generated pem file btw key and crt
  • Loading branch information
pleshakov committed Mar 17, 2016
2 parents 66cc6d5 + b2dba78 commit 00391a2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 8 additions & 2 deletions nginx-controller/nginx/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@ func (nginx *NGINXController) AddOrUpdateCertAndKey(name string, cert string, ke
}
defer pem.Close()

_, err = pem.WriteString(string(key))
_, err = pem.WriteString(key)
if err != nil {
glog.Fatalf("Couldn't write to pem file %v: %v", pemFileName, err)
}
_, err = pem.WriteString(string(cert))

_, err = pem.WriteString("\n")
if err != nil {
glog.Fatalf("Couldn't write to pem file %v: %v", pemFileName, err)
}

_, err = pem.WriteString(cert)
if err != nil {
glog.Fatalf("Couldn't write to pem file %v: %v", pemFileName, err)
}
Expand Down
9 changes: 7 additions & 2 deletions nginx-plus-controller/nginx/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,16 @@ func (nginx *NGINXController) AddOrUpdateCertAndKey(name string, cert string, ke
}
defer pem.Close()

_, err = pem.WriteString(string(key))
_, err = pem.WriteString(key)
if err != nil {
glog.Fatalf("Couldn't write to pem file %v: %v", pemFileName, err)
}
_, err = pem.WriteString(string(cert))

_, err = pem.WriteString("\n")
if err != nil {
glog.Fatalf("Couldn't write to pem file %v: %v", pemFileName, err)
}
_, err = pem.WriteString(cert)
if err != nil {
glog.Fatalf("Couldn't write to pem file %v: %v", pemFileName, err)
}
Expand Down

0 comments on commit 00391a2

Please sign in to comment.