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

Disable ssl verify #157

Open
bdrummon opened this issue Jun 24, 2024 · 3 comments
Open

Disable ssl verify #157

bdrummon opened this issue Jun 24, 2024 · 3 comments

Comments

@bdrummon
Copy link

Would it be possible to add a way to disable ssl verify in parfive? Aiohttp offers the option, but I don't see a way to pass that through to parfive? I'm having trouble downloading behind our firewall because I believe the firewall is not forwarding the appropriate cert chain. There may be a better way to handle that than disabling, but it would also be useful in debugging the situation.

@nabobalis
Copy link
Contributor

nabobalis commented Jul 30, 2024

Yeah, this would be really good to have, a simple way to disable SSL via a flag or keyword.

@nabobalis
Copy link
Contributor

You can do something like:

import ssl

ssl._create_default_https_context = ssl._create_unverified_context

from parfive import SessionConfig

def create_session(*args,**keywords):
    from aiohttp import ClientSession, TCPConnector
    return ClientSession(connector=TCPConnector(ssl=False))

from parfive import Downloader
dl = Downloader(config=SessionConfig(aiohttp_session_generator=create_session))

Then the downloader should not use SSL. Can you see if this works for you @bdrummon

@Cadair
Copy link
Owner

Cadair commented Aug 1, 2024

I am loathed to add an explicit option for this, as there are potentially infinite options we could pass through to the http layer. I know what the full SessionConfig interface is clunky but it's there to allow for the customisation without putting the burden on a very large parfive API.

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

No branches or pull requests

3 participants