italia / spid-cie-oidc-django

The SPID/CIE OIDC Federation SDK, written in Python
Apache License 2.0
23 stars 25 forks source link

add configuration flag to allow self signed cert for relying party #252

Open frhack opened 1 year ago

frhack commented 1 year ago

For test/development could be useful to have the possibility to use self signed certs for relying party

Please provide a configuration flag/switch to accept self signed certs.

I successful achieved to register a self signed relying party (https://127.0.0.1:8443/oidc/rp/) modifying the source code of the file spid_cie_oidc/entity/http_client.py as follow:

async def http_get(urls, httpc_params: dict = {}): async with aiohttp.ClientSession(**httpc_params.get("session", {}),connector=aiohttp.TCPConnector(verify_ssl=False)) as session: text = await fetch_all(session, urls, httpc_params) return text

peppelinux commented 1 year ago

Got the point,

you can do that overloading this variable HTTPC_PARAMS in the general settings (settings.py of your project, without chaning application source code) https://github.com/italia/spid-cie-oidc-django/blob/main/spid_cie_oidc/entity/settings.py#L55