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

Upgrade certifi and explicitly set the certification #118

Merged
merged 6 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
python -m pip install --upgrade certifi
python -m pip install build pytest pytest-cov coverage[toml] codecov
python -m build --sdist
python -m pip install dist/*
Expand Down
5 changes: 4 additions & 1 deletion HinetPy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from html.parser import HTMLParser
from multiprocessing.pool import ThreadPool

import certifi
import requests
from requests.adapters import HTTPAdapter
from urllib3 import PoolManager
Expand Down Expand Up @@ -184,7 +185,9 @@ def login(self, user, password):
self.session = requests.Session()
self.session.mount(self._HINET, AddedCipherAdapter())
self.session.mount(self._AUTH, AddedCipherAdapter())
self.session.get(self._AUTH, timeout=self.timeout) # get cookie
self.session.get(
self._AUTH, timeout=self.timeout, verify=certifi.where()
) # get cookie
resp = self.session.post(
self._AUTH,
data={"auth_un": self.user, "auth_pw": self.password},
Expand Down
Loading