Skip to content

Commit

Permalink
500 internal error resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
izuku-sds committed Dec 11, 2023
1 parent 3b3c2e1 commit 2a759ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/utils/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 2a759ed

Please sign in to comment.