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

ValueError: 'verify' argument can only be of type: bool, CA_Certificate or str #230

Open
elade9977 opened this issue Aug 10, 2022 · 1 comment

Comments

@elade9977
Copy link

elade9977 commented Aug 10, 2022

When running the Arango as docker with certificate (self-signed) I get the following error:

Traceback (most recent call last):
  File "connect.py", line 8, in <module>
    conn = Connection(arangoURL="https://my_url:8529", username="root", password="Aa123", verify='/opt/arangodb/certs/arangodb.pem')
  File "/home/ubuntu/.local/lib/python3.8/site-packages/pyArango/connection.py", line 227, in __init__
    self.reload()
  File "/home/ubuntu/.local/lib/python3.8/site-packages/pyArango/connection.py", line 296, in reload
    r = self.session.get(self.getDatabasesURL())
  File "/home/ubuntu/.local/lib/python3.8/site-packages/pyArango/connection.py", line 130, in __getattr__
    return AikidoSession.Holder(request_function, auth, max_conflict_retries=self.max_conflict_retries, verify=verify)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/pyArango/connection.py", line 46, in __init__
    raise ValueError("'verify' argument can only be of type: bool, CA_Certificate or str ")
ValueError: 'verify' argument can only be of type: bool, CA_Certificate or str

After a lot of debugging I notice that line in the connection.py script at line 45
if not isinstance(verify, bool) and not isinstance(verify, CA_Certificate) and not not isinstance(verify, str) :

No matter what I put in verify variable it's just not working.

I remove the double not as following:
if not isinstance(verify, bool) and not isinstance(verify, CA_Certificate) and not isinstance(verify, str) :

After that I finally got a secure connection with TLS to my ArnagoDB.

Please review this solution.

@elade9977 elade9977 reopened this Aug 15, 2022
@elade9977
Copy link
Author

Added new commit - #235

This was referenced Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant