[18.0][IMP]auth_oidc: verify self-signed certificates#837
[18.0][IMP]auth_oidc: verify self-signed certificates#837ChristophAbenthungCibex wants to merge 1 commit intoOCA:18.0from
Conversation
|
Hi @sbidoul, |
ap-wtioit
left a comment
There was a problem hiding this comment.
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.
ad30577 to
02e4c85
Compare
sbidoul
left a comment
There was a problem hiding this comment.
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.", | ||
| ) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I agree with sbidoul. If we add this kind of feature we should add a big warning in the descripiton.md and add a reference here.
There was a problem hiding this comment.
Thanks for the feedback. I renamed the fields and added a security note. Is that good enough?
| string="Self-signed verify path", | ||
| help="Path to the self-signed certificate for the verification process. " | ||
| "Empty value disables the verification.", | ||
| ) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Instead of the attributes self_signed and self_signed_verify, how about only have ca_bundle, where you can add your valid self signed certificates (automatically used, when set), and a disable_certificate_check which bypasses the check. (same as self_signed=True + self_signed_verify="")
I think this would be more clear and less risky for false configurations.
There was a problem hiding this comment.
Thanks, I renamed the field as suggested by @CRogos . I agree that this way is less risky.
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
02e4c85 to
0bd90c3
Compare
CRogos
left a comment
There was a problem hiding this comment.
Implementation LGTM.
I am not sure if the merge commit is a problem, or if it would be better to rebase your changes.
Could you also add some tests for your changes?
66ea4f0 to
2be0600
Compare
I rebased it. I'll check if I can add tests. |
2be0600 to
1199ee9
Compare
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.
1199ee9 to
5b22d17
Compare
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: