-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make wiremock accept any certificate #396
Comments
Can you post the full stack trace? I can't understand why you'd even need a cert in this instance. |
|
Ah, so this is coming from your calling code. Unfortunately, this isn't an issue with WireMock, it's your client code rejecting WireMock's self-signed certificate (which it will rightly do, unless you've explicitly configured it otherwise). You have a couple of options here:
|
Thanks Tom. I have a query which is not related to wiremock. Is there a way I can know Sent from GMail on Android Ah, so this is coming from your calling code. Unfortunately, this isn't an issue with WireMock, it's your client code
— |
By default your HTTP client will use the JVM's trust store, and therefore trust certs signed by the root certificate authorities (much like your web browser). To override this behaviour, you need to configure your HTTP client with an SSLContext (this is one way of doing it at least). I've found a few good stackoverflow posts about this, so I'd suggest starting there. |
Thanks again Tom. Sent from GMail on Android
|
Hi Tom, I am looking to override the cert with my application keystore in stand alone.
I have wiremock jar and my keystore file in the same directory. It seems I am missing something here, but unable to make out whats going wrong. Below is what I see when I execute the above.
Can you help me with what is missing...? |
@nareshk-gs did you manage to get a resolution for this? |
@tomakehurst Can you please elaborate on this? There's wiremock in my project and I have no idea how to do what you're asking: |
@afilina it depends which HTTP client you're using, but you can do it with the Apache client like this: |
hitting the endpoint in the browser (https://localhost:8443/, for example), and clicking proceed when the unsafe message shows worked for me (can also type, thisisunsafe). |
Hi,
I have defined a https stub in wiremock as follows:-
Whenever I am sending a POST request to
https://localhost:8443/oms-api/
I am getting the below exception:-javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Is it possible to tell WireMock to accept any certificate? I am on
wiremock 1.58
andjava 1.8
The text was updated successfully, but these errors were encountered: