Coder Social home page Coder Social logo

Comments (4)

ross avatar ross commented on July 19, 2024 1

I get the same result with as_completed:

from concurrent.futures import as_completed
from requests_futures.sessions import FuturesSession

session = FuturesSession()
futures = [
    session.get('https://self-signed.badssl.com/'),
    session.get('https://untrusted-root.badssl.com/'),
]

for future in as_completed(futures):
    try:
        future.result()
    except Exception as e:
        print(e)
$ test.py
HTTPSConnectionPool(host='untrusted-root.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)')))
HTTPSConnectionPool(host='self-signed.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:997)')))

This is with python 3.10

$ python --version
Python 3.10.8

from requests-futures.

iamsstef avatar iamsstef commented on July 19, 2024 1

tbh i switched to aiohttp because i couldn't figure it out, i'm trying to reproduce it again now within my code, because out of my script's function seems to produce the expected error. If i remember correctly the function was being called via asyncio.create_task. I will close the issue and if i will manage to reproduce it i'll re-open it.
Thank you for your time.

from requests-futures.

ross avatar ross commented on July 19, 2024

Can you provide a snippet of code you're using when you run into the error? I've tried and have been unable to reproduce that behavior, e.g. if I hit something that has a self-signed cert:

#!/usr/bin/env python3

from requests_futures.sessions import FuturesSession

session = FuturesSession()
future = session.get('https://self-signed.badssl.com/')
try:
    future.result()
except Exception as e:
    print(e)
$ ./test.py
HTTPSConnectionPool(host='self-signed.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:997)')))

from requests-futures.

ross avatar ross commented on July 19, 2024

Ah, problems generally arrise when mixing async types. It may be that asyncio and python threads/futures don't place nicely with each other.

from requests-futures.

Related Issues (20)

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.