j-andrews7 / kenpompy

A simple yet comprehensive web scraper for kenpom.com.
https://kenpompy.readthedocs.io/en/latest/?badge=latest
GNU General Public License v3.0
70 stars 21 forks source link

Login Failure -- "No cipher can be selected" #44

Closed jblazzy closed 1 year ago

jblazzy commented 1 year ago

Hello, I'm getting the following error when running the login method with valid login credentials:

Traceback (most recent call last): File "/Users/jblazzy/PycharmProjects/CBB23/main.py", line 14, in main() File "/Users/jblazzy/PycharmProjects/CBB23/main.py", line 8, in main browser = login(os.environ['KP_EMAIL'], os.environ['KP_PWD']) File "/Users/jblazzy/PycharmProjects/CBB23/venv/lib/python3.9/site-packages/kenpompy/utils.py", line 25, in login session.mount('https://kenpom.com/', DESAdapter()) File "/Users/jblazzy/PycharmProjects/CBB23/venv/lib/python3.9/site-packages/requests/adapters.py", line 156, in init self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block) File "/Users/jblazzy/PycharmProjects/CBB23/venv/lib/python3.9/site-packages/kenpompy/_DESAdapter.py", line 19, in init_poolmanager context = create_urllib3context(ciphers=CIPHERS) File "/Users/jblazzy/PycharmProjects/CBB23/venv/lib/python3.9/site-packages/urllib3/util/ssl.py", line 292, in create_urllib3_context context.set_ciphers(ciphers or DEFAULT_CIPHERS) ssl.SSLError: ('No cipher can be selected.',)

I'm running this in a PyCharm virtual environment using python 3.9

Has anyone else run into this?

Thanks

jblazzy commented 1 year ago

How I'm calling this with environment variables: `from kenpompy.utils import login import os

def main(): browser = login(os.environ['KP_EMAIL'], os.environ['KP_PWD'])

if name == 'main': main()`

j-andrews7 commented 1 year ago

Almost certainly related to #33 (and the fix for that). Updating to python 3.11 might help, but we need to look into this further.

jblazzy commented 1 year ago

Thanks for the pointer! I commented out these two lines from utils, and it's working now. if environment_requires_DES_adapter(): session.mount('https://kenpom.com/', DESAdapter())