Giter Site home page Giter Site logo

Comments (3)

amarao avatar amarao commented on August 14, 2024

https://pythonclock.org/

I believe now is a year 2022, and python2 is dead for two years already.

You have three options:

  1. Switch to python 3
  2. Ask your vendor to support you on this case (if you have payed supported version of python2, it's their problem now)
  3. Fix this yourself.

from forcediphttpsadapter.

ndvbd avatar ndvbd commented on August 14, 2024

I tried in python 3. When I run this code:

import requests from forcediphttpsadapter.adapters import ForcedIPHTTPSAdapter session = requests.Session() session.mount("https://cnn.com", ForcedIPHTTPSAdapter(dest_ip='151.101.1.67')) response = session.get('https://cnn.com', headers={'Host': 'cnn.com'}, verify=False) print(response.text[:150])

I get infinite loop of thee prints:

/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) /usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) /usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)

What am I doing wrong?

from forcediphttpsadapter.

amarao avatar amarao commented on August 14, 2024

It's warnings. They should not affect the code. If it's broken, that's for different reason.

You can disable them by googling InsecureRequestWarning or reading https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning

from forcediphttpsadapter.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.