adding a certificate for a https site

I want to learn more about how to add a self-signed certificate to a recording.

I record with gatling recorder that I navigate to https://github.com

but I get the error:

The certificate is not trusted because it is self-signed.
The certificate is only valid for Gatling

(Error code: sec_error_ca_cert_invalid)

after what I have red so far it is possible to add a certificate to the gatling.conf here:

`

ssl {
 trustStore {
  #type = ""
  #file = ""
  #password = ""
  #algorithm = ""
 }
 keyStore {
  #type = ""
  #file = ""
  #password = ""
  #algorithm = ""
 }
}

`

My question(s) are:

  1. How do I get my hands on the certificate?
  2. How do I specify that specific certificate in the gatling.conf?

My recorder window says:
‘secured hosts requiring accepting a certificate’:
https://github.com:443 (in red letters)

and my console says:

22:40:25.403 [ERROR] i.g.r.h.h.u.HttpsUserHandler - IOException Broken pipe, did you accept the certificate for https://github.com:443?
22:40:26.108 [ERROR] i.g.r.h.h.u.HttpsUserHandler - IOException Broken pipe, did you accept the certificate for https://github.com:443?

Thanks!

Why not just use har?

I am not familiar with HAR.
But I tried this (following the documentation):

  • Started Chrome developer tools, and chose ‘preserve log checkbox’
  • Navigated to https://github.com
  • Copied ‘All HAR’ into a file called github.har
  • Started the recorder and chose HAR converter mode in the top of the recorder
  • Pressed ‘Start’ on the recorder
  • Then I get ‘Succsessfully converted HAR file to a Gatling Simulation’
    But now I am not sure how to proceed. Do I change back to 'HTTP Proxy" in the Recorder mode and keep in recording my navigation on the github site?
    If I do stop the recording after the ‘Succsessfully converted HAR file to a Gatling Simulation’ I do not get a RecordedSimulation.

Cheers!

I idea of using har is to do all the recording. I think you are confusing it with something else.

  1. Record everything and save as har.
  2. Use recorder to convert har into Simulation.

Ok, so if I start dev tools in google chrome and navigate around on the https://github.com site and save alle the requests and responses into a HAR file.

Question: how di I save “all the requests into a HAR”

Then start the recorder and select ‘Recorder mode’ and HAR converter, and locate the file and load it in getting a successful message.

Then the script will automagically create a runnable simulation?

Thanks!

This is how you save HAR.

Save as HAR

– Then the script will automagically create a runnable simulation? – Yes