diff --git a/lib/utils/crypto.go b/lib/utils/crypto.go index ed1b934f..9a9d4055 100644 --- a/lib/utils/crypto.go +++ b/lib/utils/crypto.go @@ -30,6 +30,12 @@ func GenerateCerts(domain string, basePath string) error { return err } + // using -traditional flag to get PKCS#1 [different header], otherwise 500 Internal Error + cmd = "openssl rsa -in "+basePath+"/ca.key -out "+basePath+"/ca.key -traditional" + if err := RunCommand(cmd); err != nil { + return err + } + // Generate ca.crt cmd = "openssl req -x509 -new -nodes -sha512 -days 3650 -subj '/C=IN/ST=Delhi/L=Delhi/O=Katana/CN=" + domain + "' -key " + basePath + "/ca.key -out " + basePath + "/ca.crt" if err := RunCommand(cmd); err != nil { @@ -42,6 +48,12 @@ func GenerateCerts(domain string, basePath string) error { return err } + // using -traditional flag to get PKCS#1 [different header], otherwise 500 Internal Error + cmd="openssl rsa -in "+basePath+"/"+domain+".key -out "+basePath+"/"+domain+".key -traditional" + if err := RunCommand(cmd); err != nil { + return err + } + // Generate certificate signing request cmd = "openssl req -sha512 -new -subj '/C=IN/ST=Delhi/L=Delhi/O=Katana/CN=" + domain + "' -key " + basePath + "/" + domain + ".key -out " + basePath + "/" + domain + ".csr" if err := RunCommand(cmd); err != nil {