Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unverified HTTPS request warning on Mac OS X #17

Closed
mturquette opened this issue Jan 26, 2015 · 2 comments
Closed

Unverified HTTPS request warning on Mac OS X #17

mturquette opened this issue Jan 26, 2015 · 2 comments
Assignees
Labels

Comments

@mturquette
Copy link
Contributor

@mturquette mturquette commented Jan 26, 2015

Whenever I run jic using keychain (I haven't tried oauth) I get the following warning:

$ jls
/Library/Python/2.7/site-packages/requests/packages/urllib3/connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
➏ PMWG-807 - Can we take the first derivative of a PELT - In Progress
curve?
...

Note that the keychain bits are working, as I only had to type in my password once. I'm not sure if something needs to be added in the code to verify the cert, or if jic doesn't know how to find CAs on Mac OS X, or if perhaps the Linaro Jira server is using a cert that Mac OS X doesn't know about? I doubt that last one since Chromium doesn't complain when browsing cards.linaro.org.

@ototo ototo self-assigned this Jan 30, 2015
@mturquette
Copy link
Contributor Author

@mturquette mturquette commented Apr 1, 2015

I tried to fix this today but I'm a bit out of my depth. Following the URL linked in my original bug report I installed certifi:

sudo -H pip install certifici

And I modified jic as follows:

diff --git a/jic b/jic
index 57c36fe..28f55a9 100755
--- a/jic
+++ b/jic
@@ -35,6 +35,8 @@ import json
 import errno
 import traceback
 from collections import OrderedDict
+from requests.packages import urllib3
+import certifi


 __version__ = '15.07.1'
@@ -7297,6 +7299,11 @@ def main():

     signal.signal(signal.SIGINT, ctrl_c_handler)

+    http = urllib3.PoolManager(
+        cert_reqs='CERT_REQUIRED', # Force certificate check.
+        ca_certs=certifi.where(),  # Path to the Certifi bundle.
+    )
+
     try:
         cfg = Configuration()
         cl = CommandLine(cfg)

Any idea if the above code can be made to work?

@rwalkerands
Copy link

@rwalkerands rwalkerands commented Jan 20, 2016

Either (a) disable the warnings, or (b) enable verification.

To do (a):

import requests
requests.packages.urllib3.disable_warnings()

To do (b):
Change

options = { 'server': server, 'verify': False }

to

options = { 'server': server, 'verify': True }

in two places.

I've tested both approaches, and can confirm that they work.

@ototo ototo added the wontfix label May 18, 2016
@ototo ototo closed this May 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.