Skip to content

Conversation

@ChristophAbenthungCibex
Copy link

If the connection between odoo and an oauth provider uses self-signed certificates, a ssl error is thrown because the self-signed certificated cannot be verified.
Even if the user credentials are correct, the user will not get logged in.

Following error gets thrown:
requests.exceptions.SSLError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /realms//protocol/openid-connect/token (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1000)')))

Steps to reproduce:

  1. Setup a oauth provider (for example keycloak)
  2. Setup odoo the oauth provider in odoo (used OpenID Connect (authorization code flow) as Auth Flow for my tests)
  3. Logout
  4. Try to login with the oauth provider
  5. Type in the correct credentials
  6. The oauth provider will redirect to Odoo
  7. Odoo shows an error message and the user is not logged in

@OCA-git-bot
Copy link
Contributor

Hi @sbidoul,
some modules you are maintaining are being modified, check this out!

Copy link
Contributor

@ap-wtioit ap-wtioit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good (just the missing space is a requirement for the PR to be correct from my point of view)

This is a useful addition for checking with local HTTPS were one cannot really get official certificates.

If the connection between odoo and an oauth provider uses self-signed certificates, a ssl error is thrown because the self-signed certificated cannot be verified.
Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. A couple a comment after a quick look.

string="Self-signed",
help="Disable certificate checks for server to server token requests "
"when using self signed certificates.",
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this does not make it sufficiently clear that this enables an insecure option. Could we name this field, say, "insecure" like curl does?

string="Self-signed verify path",
help="Path to the self-signed certificate for the verification process. "
"Empty value disables the verification.",
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name this field ca_bundle, but I have a strong preference to let that be configured at the system level, or with the REQUESTS_CA_BUNDLE environment variable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me the benefit here would be that this is only for one OAuth server connection while REQUESTS_CA_BUNDLE is for all requests from Odoo to other servers.

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

Successfully merging this pull request may close these issues.

4 participants