asyrjasalo / RESTinstance

Robot Framework library for RESTful JSON APIs
https://pypi.org/project/RESTinstance
GNU Lesser General Public License v3.0
209 stars 83 forks source link

Unable to POST with creds over HTTPS #14

Closed jjwong closed 6 years ago

jjwong commented 6 years ago

When attempting to use the POST keyword to authenticate into an endpoint that doesn't have the same domain certificate, I am unable to disable the SSL validation for a successful login. I've tried to use POST without validate=False, but that fails with the domain error. Please advise.

Error message

This is not a JSON boolean: False

Example usage below

*** Settings ***
Library         REST     https://example.com

*** Test Cases ***
Test Example
    Set Headers     { "username": "atenEmp1", "password": "qatest1" }

    POST            /user/login    body={ "username": "user1", "password": "test1" }     validate=False
    Output          response
    Integer         response status                 200
Kimamisa commented 6 years ago

Not sure of why you are facing the problem. However I can tell you that validate is not for validating the certificate, but for checking the compliance of the request with the swagger/openapi spec.

jjwong commented 6 years ago

@Kimamisa Thanks for clarifying! Oddly enough, when I use validate=False, it does get past the domain error, but the 'JSON boolean' appears instead. Do you know if there are any working examples I could use? Maybe I can do some tracing from there.

jjwong commented 6 years ago

When you import the Library, you need to specify disabling ssl. Example: Library | REST | https://example.com | ssl_verify=false