1

When I connect to Rally via the python REST API (pyral), I get the following warning.

C:\PYTHON27\lib\site-packages\requests-2.6.0-py2.7.egg\requests\packages\urllib3\util\ssl_.py:79: 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. InsecurePlatformWarning

The rest works fine however but it is slightly annoying to have this warning each time.

Any idea on how to resolve the connection "issue" or hiding the warning?

The code I use is the following:

#!/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"
Jean-Francois T.
  • 11,549
  • 7
  • 68
  • 107
  • 1
    Not surprisingly, this is explained in full at [the URL that appears in the warning](https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning). Have you read it? What part do you not understand? – abarnert May 07 '15 at 10:54
  • I'm voting to close this question as off-topic because you're asking us to give you the exact information that's already in the link you provided. – abarnert May 07 '15 at 10:55
  • you can close the question. I won't mind. Thanks for your quick answer btw! – Jean-Francois T. May 07 '15 at 11:08
  • Also, check out this similar post for using requests: http://stackoverflow.com/questions/29134512/insecureplatformwarning-a-true-sslcontext-object-is-not-available-this-prevent –  Nov 01 '15 at 23:13

1 Answers1

2

The solution was in front of my eyes the whole time (thanks abarnert!)

Just needed to add:

import logging
logging.basicConfig(filename='Rally.log',level=logging.NOTSET)
logging.captureWarnings(True)
Jean-Francois T.
  • 11,549
  • 7
  • 68
  • 107