Skip to content

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

@elade9977

Description

@elade9977

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions