Skip to content

Commit

Permalink
Upgrade certifi and explicitly set the certification [skip ci] (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman authored Jun 7, 2024
1 parent 26d4312 commit fce2bbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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

0 comments on commit fce2bbf

Please sign in to comment.