Last active
April 28, 2016 14:11
-
-
Save banterCZ/fc15206069fbd7f8583a to your computer and use it in GitHub Desktop.
Soap UI WS mock script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def request = mockRequest.requestContent | |
log.info "CA Request: $request" | |
def payload = new XmlSlurper().parseText(request) | |
def csr = "${payload.Body.issueCertificate.paramIn.pkcs10}" | |
def temp = File.createTempFile('temp', '.csr') | |
temp.deleteOnExit() | |
temp.write(csr) | |
log.info "Created a temp file '$temp'" | |
def path = context.expand('${projectDir}/') | |
def openSslCommand = "openssl x509 -req -CA ${path}ca.pem -CAkey ${path}ca.key -CAcreateserial -days 500 -in $temp.absolutePath" | |
log.info "Going to call command '$openSslCommand'" | |
def certificate = openSslCommand.execute().text | |
requestContext.cert = certificate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment