robotframework-requests: Host not responding error with https (same host works with http)

Hi,

I am trying to use this library for automating the tests of our rest api.

It works well for http requests. But when I try to use https (unverified, self-signed certificates), I run into the following issue:

group Retrieval Test Case :: Gets the list of grou... 
Server: foo.com
...
Session created with foo.com
[ WARN ] host=foo.com uri: /mycontext not responding, Retrying in 0.93 seconds ...
[ WARN ] host=foo.com uri: /mycontext not responding, Retrying in 1.87 seconds ...
[ WARN ] host=foo.com uri: /mycontext not responding, Retrying in 4.33 seconds ...
[ ERROR ] host=foo.com uri: /mycontext not responding, Max. Retries reached quitting !!!
group Retrieval Test Case :: Gets the list of grou... <path>/ssl_.py:307: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  warnings.warn(
<path>ssl_.py:114: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  warnings.warn(
...
...
group Retrieval Test Case :: Gets the list of grou... | FAIL |
RetryException: host=foo.com uri: /mycontext not responding

The following is my test case:

*** Settings ***
Documentation     Test Suite
Library           OperatingSystem
Library           String
Library           RequestsLibrary
Library           Collections         
Resource          variables.txt

*** Test Cases ***

group Retrieval Test Case
    [Documentation]                         Gets the list of groups in the system
    [Tags]                                  SAMPLE
    Log To Console                          \nServer: foo.com
    ${auth}=                                Create List  user   password
    Create Session                          fooAlias        https://foo.com      auth=${auth}       verify=False    debug=1
    Log To Console                          \nSession created with foo.com
    ${resp}=                                Get Request       fooAlias         /mycontext
    Should Be Equal As Strings              ${resp.status_code}    200

To troubleshoot, I tried to manually run the “create_session” method and “get_request” method with appropriate arguments in the python interpreter and there I get a 200 response.

Could you please help identify what’s going wrong here?

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 20 (1 by maintainers)

Most upvoted comments