Forum Discussion

Accenture_Austr_1's avatar
Accenture_Austr_1
New Contributor
14 years ago

Access SSL Cert and run multiple Mock Services

Hi

I posted this in the free section, and then discovered our Pro forum account..I'll copy and paste the text from the original post:

I'm implementing mutual authentication with a SoapUI MockService and need to programatically access some of the information in the 'SSL Info' tab under the request. I see from the API that I can do this with the GetSSLInfo() call to return an SSLInfo object..however the MockRequest object doesn't expose the same type of information that a regular HTTP Request does.

Also, I'm having trouble running multiple Mock Services. The website says
You can create multiple MockServices on the same port and path, soapUI will ask each in turn to dispatch an incoming request until the request is handled

but I have not managed to get this to work. It will only dispatch requests from whichever Mock Service I run first.


Thanks!
  • calandale's avatar
    calandale
    Occasional Contributor
    Been hoping for any help with this kind of issue (not mocks - but I suspect it's the same base)
    for a few days. Pretty much at the point where I'm going to suggest we cancel our pro licenses -
    easier to meet needs without the tool.
  • calandale's avatar
    calandale
    Occasional Contributor
    lol

    Pretty much coincides with our experience.

    Ended up suggesting a 'no renewal' due to combination of lack of documentation and lack of support.
  • They did reply, yesterday, via email.

    No luck with the multiple MockServices - they asked me to try the latest 4.0.2 nightly build, which I haven't done yet since I'm running the 4.5 Beta.

    With regards to SSL certificate information, I managed to extract it using Jetty:

    def v = (java.security.cert.X509Certificate[]) mockRequest.getHttpRequest().getAttribute("javax.servlet.request.X509Certificate")
    if(v.length < 1)
    {
    log.error "No certificates found in the request"
    return
    }
    if(!(v[0] instanceof java.security.cert.X509Certificate))
    {
    log.error "Certificate in wrong format"
    return
    }