Forum Discussion

TNeuschwanger's avatar
TNeuschwanger
Champion Level 2
12 years ago

How to get the content of "SSL Info" from Groovy

Hello,

I am trying to capture the content of the "SSL Info" tab from a successful SOAP service method response from an https endpoint. The response "SSL Info" tab contains text that I would like to capture from groovy. I can get the content of the "Headers" tab with the following code:

def methodName = "RealTimeTransaction";
def responseHeadersMap = context.testCase.testSteps[methodName].testRequest.response.responseHeaders;

Does anyone have an example to get the "SSL Info" tab content?

I tried:

def methodName = "RealTimeTransaction";
def responseSSLInfo = context.testCase.testSteps[methodName].testRequest.response.SSLInfo;

but that did not return what I see in the tab.

Regards

1 Reply

  • Just a few minutes more and I wouldn't have needed to post the question...

    sslResponse0 = context.testCase.testSteps[methodName].testRequest.response.SSLInfo.getCipherSuite();
    log.info 'sslResponse0=' + sslResponse0;
    sslResponse1 = context.testCase.testSteps[methodName].testRequest.response.SSLInfo.getPeerCertificates();
    log.info 'sslResponse1=' + sslResponse1;

    use the following for more information contained in the "SSL Info" tab...
    java.lang.String getCipherSuite()
    java.security.cert.Certificate[] getLocalCertificates()
    java.security.Principal getLocalPrincipal()
    java.security.cert.Certificate[] getPeerCertificates()
    java.security.Principal getPeerPrincipal()
    boolean isPeerUnverified()