When I started to use the RESTinstance library, it was super easy to do schema and RESTful API testing. However, my next task was to do some basic authentication API testing for one of our development environments. Initially, when I connected to our basic auth. endpoint, I was getting a domain certification error. SSL certification verification is enabled by default in the RESTinstance library, which is a good thing, but since we didn't have a certificate ready yet, we needed to disable it for the time being.
Luckily, its super easy to disable SSL certificate verification in the RESTinstance library! It's just a simple boolean you pass in when you import the library.
In our example below, we disable verification by adding the boolean `ssl_verify=False` in our import, and to demonstrate Basic Authentication using the RESTinstance library, we also pass in the user credentials to a login endpoint. We then check the response codes for a successful login. The example below will not work with the website listed, it is just there to demonstrate the concept of how it would work with your own endpoint. Good luck!
Example
Luckily, its super easy to disable SSL certificate verification in the RESTinstance library! It's just a simple boolean you pass in when you import the library.
In our example below, we disable verification by adding the boolean `ssl_verify=False` in our import, and to demonstrate Basic Authentication using the RESTinstance library, we also pass in the user credentials to a login endpoint. We then check the response codes for a successful login. The example below will not work with the website listed, it is just there to demonstrate the concept of how it would work with your own endpoint. Good luck!
Example
** Settings ***
Library REST https://example.com ssl_verify=false
*** Test Cases ***
Basic Auth Example
POST /user/login body={ "username": "Batman", "password": "robinpwd1940" }
Output response
Integer response status 200
RESTinstance - How to disable SSL Verification
Reviewed by JJ The Engineer
on
3:30 PM
Rating:
No comments: