How can I make a GET call using Rest-Assured in java to a endpoint which requires certificate. I have certificate as .pem
format. In PEM file there is certificate and private key.
To obtain an HTTPS certificate, perform the following steps: Create a private and public key pair, and prepare a Certificate Signing Request (CSR), including information about the organization and the public key. Contact a certification authority and request an HTTPS certificate, based on the CSR.
We generally encounter these issues in test environment when trusted certificate is not available (Trusted certificate are always reserved for production). To resolve the issue with SSL certifcate, RestAssured provides implementation in SSLConfig() package.
In my case using "relaxed HTTPs validation" fixed my problem:
given().relaxedHTTPSValidation().when().post("https://my_server.com")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With