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

InsecurePlatformWarning - Insecure Platform Warning - A true SSLContext object is not available. #339

Closed
chriddyp opened this issue Oct 23, 2015 · 5 comments
Labels

Comments

@chriddyp
Copy link
Member

Issue
SSL verification.

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.

Solution
$ pip install requests[security] # see warning below
Which installs

  • pyOpenSSL
  • ndg-httpsclient
  • pyasn1

Learn more on Stack Overflow

WARNING for MAC OSX and Anaconda Users
pip install requests[security] may fail on Mac OSX environments using the python Anaconda distribution. The error is Library not loaded: libssl.1.0.0.dylib. Learn more in this pyOpenSSL GitHub thread. Until this is resolved, I recommend using a standard python distribution with pip and virtualenv.

For this reason, we have (unfortunately) taken out requests[security] as a requirement for plotly. See the PR #248.

Traceback

site-packages\requests\packages\urllib3\util\ssl_.py:100: 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.

---------------------------------------------------------------------------
SSLError                                  Traceback (most recent call last)
<ipython-input-25-e51e2a27c93a> in <module>()
----> 1 py.plot(data, filename='s0_first_plot')

site-packages\plotly\plotly\plotly.py in plot(figure_or_data, validate, **plot_options)
    212                 pass
    213     plot_options = _plot_option_logic(plot_options)
--> 214     res = _send_to_plotly(figure, **plot_options)
    215     if res['error'] == '':
    216         if plot_options['auto_open']:

site-packages\plotly\plotly\plotly.py in _send_to_plotly(figure, **plot_options)
   1228
   1229     r = requests.post(url, data=payload,
-> 1230                       verify=get_config()['plotly_ssl_verification'])
   1231     r.raise_for_status()
   1232     r = json.loads(r.text)

site-packages\requests\api.py in post(url, data, json, **kwargs)
    107     """
    108
--> 109     return request('post', url, data=data, json=json, **kwargs)
    110
    111

site-packages\requests\api.py in request(method, url, **kwargs)
     48
     49     session = sessions.Session()
---> 50     response = session.request(method=method, url=url, **kwargs)
     51     # By explicitly closing the session, we avoid leaving sockets open which
     52     # can trigger a ResourceWarning in some cases, and look like a memory leak

site-packages\requests\sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    469         }
    470         send_kwargs.update(settings)
--> 471         resp = self.send(prep, **send_kwargs)
    472
    473         return resp

site-packages\requests\sessions.py in send(self, request, **kwargs)
    577
    578         # Send the request
--> 579         r = adapter.send(request, **kwargs)
    580
    581         # Total elapsed time of the request (approximately)

site-packages\requests\adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    428         except (_SSLError, _HTTPError) as e:
    429             if isinstance(e, _SSLError):
--> 430                 raise SSLError(e, request=request)
    431             elif isinstance(e, ReadTimeoutError):
    432                 raise ReadTimeout(e, request=request)

SSLError: [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
@iaiti
Copy link

iaiti commented Nov 3, 2015

tks!

@iaiti
Copy link

iaiti commented Nov 3, 2015

Could i translate it to Chinese and help others who have the same problem?

@chriddyp
Copy link
Member Author

chriddyp commented Nov 3, 2015

the exception or this explanation? we don't actually raise the exception so we can't control that language, but by all means feel free to explain the issue in this thread in Chinese! thank you!

Sent from my iPhone

On Nov 2, 2015, at 9:55 PM, iaiti notifications@github.com wrote:

Could i translate it to Chinese and help others who have the same problem?


Reply to this email directly or view it on GitHub.

@iaiti
Copy link

iaiti commented Nov 4, 2015

I translate the solution,because i can not find the solution in Chinese website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@chriddyp @iaiti @jonmmease and others