Skip to content

Commit

Permalink
Openssl pkcs12 run on test now tries with and without -legacy (#22)
Browse files Browse the repository at this point in the history
openssl pkcs12 run on test now tries with and without -legacy
  • Loading branch information
Joaquimmnetto committed Feb 6, 2024
1 parent 6360333 commit 90691b6
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/test/groovy/com/wooga/security/SecurityHelper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,27 @@ class SecurityHelper {
'-passout', "pass:${password}", '-legacy'
]
def sout = new StringBuilder(), serr = new StringBuilder()

//run with -legacy
def proc = args.execute()
proc.consumeProcessOutput(sout, serr)
if (proc.waitFor() == 0) {
// if success, great, we have our result
return p12
}

//if -legacy fails, run without -legacy
args = args.remove('-legacy')
proc = args.execute()
proc.consumeProcessOutput(sout, serr)
if(proc.waitFor() == 0) {
//success without -legacy, we have our result
return p12
} else {
println(sout)
println("====stderr====")
println(serr)
}
//on error, print process output to help with debug
println(sout)
println("====stderr====")
println(serr)
return null
}

Expand Down

0 comments on commit 90691b6

Please sign in to comment.