Apache JMeter accepting expired SSL certificate - jmeter

I observed while testing an external web service from my java program is returning:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: timestamp check failed
But the same URL is accessible via Jmeter and SOAP UI. Based on some googling seems SOAP UI ignores hostname verification and expired certs checks but not getting enough information on Jmeter.
Does Jmeter ignores SSL handshakes error when certs are expired? Appreciate any help to enforce such validation.

By default JMeter doesn't do any check on certificate :
It accepts certificates invalid for current hosts
It accepts expired certificates
This is to allow using it in QA Environment where both conditions are very frequent

Related

SSL Handshake Exception while Load test using Jmeter in Jenkins

Hi I am integrating the Jmeter with the opeshift pipeline using Jenkins to test my API(https). When the Jmeter is trying to send the request to the API I am getting following error:
Non HTTP response code: javax.net.ssl.SSLHandshakeException - Non HTTP response message: java.security.cert.CertificateException: No name matching <> found
I have tried steps to ignore the SSL certificate verification but I am unable to bypass the process.
I have created a spring boot project to run the load test as a pipeline. I am using <groupId>com.lazerycode.jmeter</groupId> and using the the jmeter file with extension .jmx to run in jenkins.
As per SSL Encryption chapter of JMeter Documentation:
The JMeter HTTP samplers are configured to accept all certificates, whether trusted or not, regardless of validity periods, etc. This is to allow the maximum flexibility in testing servers.
If the server requires a client certificate, this can be provided.
So by default JMeter will trust all certificates no matter of their validity, incomplete chain, subject not matching dns hostname, etc.
If might be the case that your application requires JMeter to send client certificate for security reasons, it can be done either using SSL Manager or providing the relevant system properties pointing to the keystore where the certificate lives. See How to Set Your JMeter Load Test to Use Client Side Certificates article for more details

Unable to call service from ESB

We are able to call web service from postman or custom request generator. However, while connecting using IBM Integration bus we are getting below exception. Can some one help with this error.
Exception below:
"Web Service request has detected a SOCKET error whilst invoking a web
service located at host &1, on port &2, on path &3."
"javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.j: PKIX path
building failed: java.security.cert.CertPathBuilderException:
PKIXCertPathBuilderImpl could not build a valid CertPath.; internal
cause is: java.security.cert.CertPathValidatorException: The
certificate issued by CN=VeriSign Universal Root Certification
Authority, OU="(c) 2008 VeriSign, Inc. - For authorized use only",
OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US is not trusted;
internal cause is: java.security.cert.CertPathValidatorException:
Certificate chaining error"
To resolve this problem, you should add the certificate into your trust store.
To setup the truststore on broker :
https://www.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ac56640_.htm
To retrieve the certificate of the service you are calling, you can ask for it to your contact, or you can just go to the ?wsdl page and directly save the certificate from chrome
PS : If it works for other tools, it is simply because IIB refuse all the untrusted connexions by default, while some other tool allow it.

how can i install root CA certification in jmeter?

I'm getting the following error trying to install a root CA certificate in Apache JMeter:
What should I do?
This is not an error at all, it's information message regarding JMeter created a self-signed SSL certificate.
Due to security reasons JMeter prints some information regarding the certificate so you could decide whether to accept it or not when you'll open a page over HTTPS protocol in browser.
So when browser prompts you whether to proceed to secure page using untrusted certificate or not - just double check certificate authority and if it matches what JMeter tells in that dialog - you're good to go.
References:
Installing the JMeter CA certificate for HTTPS recording chapter of the HTTP(S) Test Script Recorder (was: HTTP Proxy Server ) User Manual page
Recording HTTPS Traffic with JMeter's Proxy Server

TIBCO - Server Certificate Rejected by Chain Verifier

We are getting this error
"BW-HTTP-100300 Job-29000 Error in [Processes/Services/HTTP Request/Process Definition.process/Send HTTP Request]
An IOException was thrown while trying to execute the Http method
caused by: java.io.IOException: Failed to create secure client socket: Server certificate rejected by ChainVerifier"
I have done the following:
1. Created send http request.
2. Configured everything in the Configuration tab and the Input tabs. 
3. Created Identity and imported the same into Identity
4. Downloaded the certificate and imported it in to 'Configure SSL'
5. While running the process I get the error mentioned above. 
Am I missing anything?  
Please provide me some guidance.  Thanks in advance
Downloading the server certificate is not enough, you need to download the whole certificate chain from the root CA down to the server cert.
In the above example, you need to download all certs (except the last one mail.google.com which is optional) and add them to your trusted certificates folder.
Have you enabled VerifyHostName option while making the connection? If yes, then the server name should be in the allowed list too. In most cases you dont need this option enabled.

Problem with JMeter and HTTP Proxy Server with SSL

We are using JMeter 2.4 and are trying to use the HTTP Proxy Server to capture a test plan.
"Attempt HTTPS spoofing" is not ticked.
The error we get in the JMeter log is:
2010/08/02 14:46:02 ERROR - jmeter.protocol.http.proxy.Proxy: Problem with SSL certificate? Ensure browser is set to accept the JMeter proxy cert:
Connection closed by remote host
2010/08/02 14:46:02 INFO - jmeter.protocol.http.sampler.HTTPSampler: Error Response Code: 404
2010/08/02 14:46:02 INFO - jmeter.protocol.http.sampler.HTTPSampler: Error Response Code: 404
2010/08/02 14:46:02 ERROR - jmeter.protocol.http.proxy.Proxy: java.net.SocketException: Connection closed by remote host
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at org.apache.jmeter.protocol.http.proxy.Proxy.writeToClient(Proxy.java:443)
at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:264)
Any ideas?
You must remove in your browser the auto-signed certificat in relation with your website, and restart a record session with JMeter 2.4. In this new session, accept the JMeter's dummy cert.
(in Firefox : Options > Advanced > Encryption > View Certificates ==> Certificat Manager > Servers > choose website cert and Delete...)
Milamber
From http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Proxy_Server
When recording HTTPS, the JMeter proxy
server uses a dummy certificate to
enable it to accept the SSL connection
from the browser. This certificate is
not one of the certificates that
browsers normally trust, and will not
be for the correct host, so the
browser should display a dialogue
asking if you want to accept the
certificate or not. For example: 1)
The server's name "www.example.com"
does not match the certificate's name
"JMeter Proxy". Somebody may be trying
to eavesdrop on you. 2) The
certificate for "JMeter Proxy" is
signed by the unknown Certificate
Authority "JMeter Proxy". It is not
possible to verify that this is a
valid certificate. You will need to
accept the certificate in order to
allow the JMeter Proxy to intercept
the SSL traffic in order to record it.
You should only accept the certificate
temporarily.
Also see here http://osdir.com/ml/jmeter-dev.jakarta.apache.org/2009-08/msg00005.html
You may have to create the certificate for Jmeter. Below is a fantastic article detailing how to do it:
http://www.java-samples.com/showtutorial.php?tutorialid=210
Install Jmeter Chrome extension which records HTTPS protocol without any issue.

Resources