Chavithra / degiro-connector

This is yet another library to access Degiro's API.
BSD 3-Clause "New" or "Revised" License
220 stars 48 forks source link

ssl.SSLError: ('No cipher can be selected.',) #38

Closed hvandenesker closed 2 years ago

hvandenesker commented 2 years ago

I tried to run example, but all fail due to:

Traceback (most recent call last):
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 184, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/Users/birdie/PycharmProjects/degiro-connector/examples/quotecast/realtime_poller.py", line 23, in <module>
    quotecast_api.connect()
  File "/Users/birdie/PycharmProjects/degiro-connector/degiro_connector/core/abstracts/abstract_action.py", line 72, in __call__
    return self.call(*args, **kwargs)
  File "/Users/birdie/PycharmProjects/degiro-connector/degiro_connector/quotecast/actions/action_connect.py", line 66, in call
    session = self.session_storage.session
  File "/Users/birdie/PycharmProjects/degiro-connector/degiro_connector/core/models/model_session.py", line 85, in session
    self.__local_storage.session = self.build_session(
  File "/Users/birdie/PycharmProjects/degiro-connector/degiro_connector/core/models/model_session.py", line 68, in build_session
    session.mount("https://", TLSAdapter())
  File "/Users/birdie/Library/Python/3.8/lib/python/site-packages/requests/adapters.py", line 129, in __init__
    self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block)
  File "/Users/birdie/PycharmProjects/degiro-connector/degiro_connector/core/models/model_session.py", line 22, in init_poolmanager
    ctx.set_ciphers("DEFAULT@SECLEVEL=1")
ssl.SSLError: ('No cipher can be selected.',)

Using OsX (BigSur)

Chavithra commented 2 years ago

Hello there,

no idea what this is.

You can add me on Discord to take a look at this when we both have some free time.

hvandenesker commented 2 years ago

I did some experimentation myself. New to python, but removing the line:

ctx.set_ciphers("DEFAULT@SECLEVEL=1")

from model_session I am able to login and get transactions etc. For me this solves the issue for now. So, is this line necessary ?

Chavithra commented 2 years ago

Was not able to reproduce the issue for which I have put this code :

ctx.set_ciphers("DEFAULT@SECLEVEL=1")

Maybe it is not required anymore.

Disabled this code by default : will remove it after a while if no one complains.

Published a new version : 2.0.10

Let me know if that works on your side.