karate icon indicating copy to clipboard operation
karate copied to clipboard

mTLS does not appear to be working

Open staffier opened this issue 1 year ago • 4 comments

I've setup a Karate client & server using two key/cert pairs to test X509/mTLS authentication. The client side looks like this:

* configure ssl = { keyStore: 'server-keystore.p12', keyStorePassword: 'karate-mock', keyStoreType: 'pkcs12' }

...and the server is launched using a different key/cert combo:

* karate.start({ mock: 'server.feature', port: 8080, ssl: true, key: 'x-server-keystore-key.pem', cert: 'x-server-keystore-cert.pem' })

My expectation was a handshake error, given the mis-match ("server-keystore" vs. "x-server-keystore"), but instead the client and server communicate just fine.

Sample project is attached, and apologies in advance if this is all just user error & a bad setup! KarateTroubleshooting.zip

staffier avatar Mar 07 '23 17:03 staffier

This could perhaps be similar to what was documented here: https://github.com/karatelabs/karate/issues/1926

staffier avatar Mar 07 '23 17:03 staffier

@staffier any idea if this is the same as https://github.com/karatelabs/karate/issues/2270 ?

ptrthomas avatar Aug 09 '23 05:08 ptrthomas

Pretty sure I tested this out again when 2270 was fixed and still ran into this issue, so I don't think so, but I can try to recreate things again later today and let you know.

staffier avatar Aug 09 '23 14:08 staffier

@staffier ah ok, no that's fine, I was just trying my luck !

ptrthomas avatar Aug 09 '23 14:08 ptrthomas