Materials-Consortia / Materials-Consortia/optimade-python-tools

SSL verification is not turned off despite setting skip_ssl = True

Open
#2,130 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
91
Forks
54
PR merge metrics
No merged PRs in 30d

Description

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:

https://github.com/Materials-Consortia/optimade-python-tools/blob/86f7fa8bc31af30c6f4ed1fdcce271a24e245719/optimade/client/client.py#L950

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in optimade/client/client.py around line 950 and trace how OptimadeClient.skip_ssl reaches the HTTP client. Reproduce the request with skip_ssl=True, then confirm that SSL verification changes only when that flag is set. Done means the flag has the documented effect without changing default verification behavior; check for relevant client tests before adding regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.