Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REM] base: use of PyOpenSSLContext in mail server
The mail server mostly doesn't use the intrinsic features of `PyOpenSSLContext`, instead it pretty much just uses the underlying `OpenSSL.SSL.Context`, just through the wrapper. The only thing it actually uses from `PyOpenSSLContext` is `load_cert_chain`, and since we are using a keyfile and are not using a password this is equivalent to *two* function calls. Just perform those two calls directly, remove all the indirections, and remove the unnecessary import. Bonus content: since 2.0 `load_cert_chain` reraises the inner errors as `ssl.SSLError` which we don't handle, so we avoid this extra issue. This was discovered because from 2.0.0 to 2.0.4 the `contrib.pyopenssl` module was marked as deprecated (it was undeprecated in 2.0.5) but regardless its use is an unnecessary complication here. closes odoo#137198 X-original-commit: e534bbe Signed-off-by: Xavier Morel (xmo) <[email protected]>
- Loading branch information