python - 使用 python(使用 pyral)连接到 Rally 时出现警告 "InsecurePlatformWarning"

标签 python ssl rally pyral

当我通过 python REST API (pyral) 连接到 Rally 时,我收到以下警告。

C:\PYTHON27\lib\site-packages\requests-2.6.0-py2.7.egg\requests\packages\urllib3\util\ssl_.py:79: InsecurePlatformWarning: 真正的 SSLContext 对象是无法使用。这会阻止 urllib3 正确配置 SSL,并可能导致某些 SSL 连接失败。有关详细信息,请参阅 https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning。 不安全平台警告

其余部分工作正常,但每次都有此警告有点烦人。

关于如何解决连接“问题”或隐藏警告的任何想法?

我使用的代码如下:

#!/usr/bin/env python
from pyral import Rally, rallySettings, RallyRESTAPIError

#####################################
###      CONNECTION TO RALLY      ###
#####################################
#Configuration parameters
my_server = rally1.rallydev.com
my_user = "hello@world.com"
my_password    = "toto"
my_workspace   = "Sandbox"
my_project     = "My Project"
#Connect to Rally
try:
    rally = Rally(my_server, my_user, my_password, workspace=my_workspace, project=my_project)
except RallyRESTAPIError, details:
    sys.stderr.write('ERROR: %s \n\n' % details)
rally.enableLogging('rally.simple-use.log')
print "\n"

最佳答案

解决方案一直在我眼前(感谢 abarnert!)

只需要添加:

import logging
logging.basicConfig(filename='Rally.log',level=logging.NOTSET)
logging.captureWarnings(True)

关于python - 使用 python(使用 pyral)连接到 Rally 时出现警告 "InsecurePlatformWarning",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30098960/

相关文章:

python - 控制 ipython 历史长度

ssl - 减少 Wildfly 日志中的 javax.net.ssl 噪音

ssl - 在 node.js 中使用 https.request 时套接字挂起

javascript - 对于 "Story Board"应用程序,Rally-app-builder 在浏览器中不显示任何内容

javascript - 向图表添加数据

python - Genshin中nl2br的方法是什么?

python - 在redis中存储带或不带散列的键值对

python - Django REST Framework 如何将上下文添加到 ViewSet

asp.net - 如何导出 "IIS Express Development Certificate"到另一台电脑通过https连接本地IIS?

python - 工件批量更新