The requests\packages\urllib3\util\ssl_.py:100:insecureplatformwarning of Python problems

Source: Internet
Author: User
Tags python mysql plotly

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.


Recently, in writing a crawler, the front with flask and jinja2 and Python MySQL connection to do the next simple data interaction login verification, compared to the Java struts such control, indeed Python is simpler.


Why use Python, once I use Java to decrypt a thing, a half-day solution does not come out, base64 write up is also a mess, to Java8 comes with. After using Python, the next two lines of code are tried.


When using requests, Access is the HTTPS type of URL, because HTTPS with SS encryption, will be reported this insecureplatformwarning, platform non-security warning, probably with HTTPS, and then checked the next solution.

URL of the direct warning message https://urllib3.readthedocs.org/en/latest/security.html

Insecureplatformwarning
New in version 1.11.


Certain python platforms (specifically, versions of Python earlier than 2.7.9) has restrictions in their SSL module that Limit the configuration that URLLIB3 can apply. In particular, this can cause HTTPS requests that would succeed on more featureful platforms to fail, and can cause Certai n security features to be unavailable.


If you encounter this warning, it's strongly recommended you upgrade to a newer Python version, or so you use Pyopenssl As described in the Openssl/pyopenssl section.


The SSL module that restricts the configuration applied by the URLLIB3 is limited in some Python versions (especially before 2.7.9), specifically, which causes the HTTPS request to succeed on a more functional platform and cause some security function modules to fail.
If you encounter this warning, it is highly recommended to upgrade to a higher version of the Python version, or in the Openssl/pyopenssl section described, you will use Pyopenssl.


https://github.com/plotly/plotly.py/issues/339


Follow the article's workaround, use pip install requests[security], and no more warnings after installation.
This will install the PYOPENSSL,NDG-HTTPSCLIENT,PYASN1.


Before using this command, the Python environment will first install PIP. Pip is a tool for installing the management Python package.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The requests\packages\urllib3\util\ssl_.py:100:insecureplatformwarning of Python problems

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.