RWTH-EBC / FiLiP

FIWARE Library for Python (FiLiP) to work with FIWARE API
BSD 3-Clause "New" or "Revised" License
23 stars 14 forks source link

Add option to disable certificate validation #326

Open mschroeder-fzj opened 1 month ago

mschroeder-fzj commented 1 month ago

Is your feature request related to a problem? Please describe. When the module makes requests towards a FIWARE deployment (orion / iot-agent), that has e.g. self-signed certificates, the requests will fail with a Certificate Validation error.

Describe the solution you'd like It should be possible to disable the certificate validation via a global defined variable like ssl_verify = True. In the corresponding request section it could look like:

with requests.Session() as s:
    if isinstance(ssl_verify, bool) and not ssl_verify
        s.verify = False
djs0109 commented 1 month ago

@mschroeder-fzj you are right, this need to be set manually so far. We have also met the same issue, and "bypassed" it just like you did. I would probably not add a global option, because the use of session is optional. But it is good to include it to one of our tutorials/exampls. @mschroeder-fzj Let me know whether you have the time to contribute. Ohterwise, I or someone will take care of it :)

Btw. @mwr-ebc you have tried adding the self-signed certificates to the trusted list, right?

mschroeder-fzj commented 1 month ago

It doesn't have to be a completly global option. As long as the option can be set when using session would be enough.

I don't know enough about the code to confidently contribute.