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

SSL verification is not turned off despite setting skip_ssl = True #2130

Open
mehmetgiritli opened this issue Aug 12, 2024 · 4 comments
Open

Comments

@mehmetgiritli
Copy link

Instantiating OptimadeClient with the skip_ssl flag like so:

from optimade.client import OptimadeClient

client = OptimadeClient(skip_ssl= True, ...)

Does not really have any effect on disabling SSL verification. I was able to sort myself out for the time being by hacking away here:

async with self._http_client(headers=self.headers) as client: # type: ignore[union-attr,call-arg,misc]

into this:

async with self._http_client(headers=self.headers, verify = not self.skip_ssl) as client:  # type: ignore[union-attr,call-arg,misc]

Not sure of the ramifications tough.

@ml-evs
Copy link
Member

ml-evs commented Aug 12, 2024

Thanks @mehmetgiritli, this is probably just a poorly named option, the SSL skip is only meant to apply to downloading of the providers list (which had an expired cert at some point). I don't think I want to add SSL skipping generally. Do you have a use case for it?

@mehmetgiritli
Copy link
Author

mehmetgiritli commented Aug 13, 2024

We are developing an Optimade APi with this library, but we also want to consume it using the client. Since the API is in various development environments and these tend to have self-signed certs, we need to have the client tolerate self-signed certs, while under development.

Hope that makes sense.

Thank you @ml-evs

@ml-evs
Copy link
Member

ml-evs commented Aug 14, 2024

Ah I see, in that case I'd be happy to add a way to run the client with SSL turned off on a given URL, rather than allowing SSL-less requests to all of OPTIMADE. Would you be interested in preparing a PR containing the changes above? Otherwise I can take a look at this when I get a moment.

@mehmetgiritli
Copy link
Author

OK, that makes sense. I'll do a PR when I get around to it. Thank you :-)

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

2 participants