Skip to content

Commit

Permalink
adding missing buffer flush
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Feb 23, 2021
1 parent c8614c5 commit ca04767
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/sslcert/sslcert.go
Expand Up @@ -133,6 +133,7 @@ func Generate(options Options) (privateKey, publicKey []byte, err error) {
err = fmt.Errorf("Failed to write data to cert.pem: %v", err)
return
}
pubKeyBufb.Flush()

privBytes, err := x509.MarshalPKCS8PrivateKey(priv)
if err != nil {
Expand All @@ -146,6 +147,7 @@ func Generate(options Options) (privateKey, publicKey []byte, err error) {
err = fmt.Errorf("Failed to write data to key.pem: %v", err)
return
}
privKeyBufb.Flush()

return pubKeyBuf.Bytes(), privKeyBuf.Bytes(), nil
}
2 changes: 1 addition & 1 deletion simplehttpserver.go
Expand Up @@ -46,7 +46,7 @@ func main() {
flag.BoolVar(&opts.HTTPS, "https", false, "HTTPS")
flag.StringVar(&opts.Certificate, "cert", "", "Certificate")
flag.StringVar(&opts.Key, "key", "", "Key")
flag.StringVar(&opts.Domain, "domain", "", "Domain")
flag.StringVar(&opts.Domain, "domain", "local.host", "Domain")
flag.BoolVar(&opts.Verbose, "v", false, "Verbose")
flag.StringVar(&opts.BasicAuth, "basic-auth", "", "Basic auth (username:password)")
flag.StringVar(&opts.Realm, "realm", "Please enter username and password", "Realm")
Expand Down

0 comments on commit ca04767

Please sign in to comment.