InsecureRequestWarning:在 Robot Framework 中发出未经验证的 HTTPS 请求。

InsecureRequestWarning: Unverified HTTPS request is being made in Robot Framework.

您好,我正在使用机器人框架。

我正在尝试发送获取请求,但收到以下警告

C:\Python27\lib\site-packages\urllib3-1.21.1-py2.7.egg\urllib3\connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)

有人遇到过这个问题吗?当我搜索解决方案时,其中一个建议是禁用警告,但如何做到这一点?

提前致谢,

以下测试用例运行完美,没有显示警告。 请注意 Create Session 关键字上的选项 verify=true

*** Settings ***
Library           Collections
Library           String
Library           RequestsLibrary
Library           OperatingSystem

*** Test Cases ***
Get Requests
    [Tags]    get
    Create Session    google    http://www.google.com    verify=true
    Create Session    github    https://api.github.com    verify=true
    ${resp}=    Get Request    google    /    timeout=5
    Should Be Equal As Strings    ${resp.status_code}    200
    ${resp}=    Get Request    github    /users/bulkan    timeout=5
    Should Be Equal As Strings    ${resp.status_code}    200
    Dictionary Should Contain Value    ${resp.json()}    Bulkan Evcimen

verify=true一起创建会话,默认为verify=false

Create Session test_session http://www.example.com **verify=true**