Resolve "Can't save pages domain form with Let's Encrypt enabled if current certificate is outdated"
What does this MR do?
When we check for intermediate certificates we actually just check if the certificate is valid now. It can be valid for a lot of reasons including expiration.
This prevents user from enabling Let's Encrypt integration:
This MR just turns off intermediates validation unless user changed certificate.
Alternative approaches:
- Check error codes:
# This forces to load all intermediate certificates stored in `certificate`
Tempfile.open('certificate_chain') do |f|
f.write(certificate)
f.flush
store.add_file(f.path)
end
store.verify(x509)
# store.error will contain error code, and we check only for missing intermediates
- Set time for validation:
# This forces to load all intermediate certificates stored in `certificate`
Tempfile.open('certificate_chain') do |f|
f.write(certificate)
f.flush
store.add_file(f.path)
end
store.time = x509.not_after
store.verify(x509)
They both will fix the current problem, but I think we can have similar issues later, so just disabling validation feels right.
NOTE: intermediates validation does not in any way depends on private_key
, we check for consistency of key
and certificate
in another validation method.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #64870 (closed)