-
Notifications
You must be signed in to change notification settings - Fork 2.2k
tls_manager: Handle partial TLS files #10399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
tls_manager: Handle partial TLS files #10399
Conversation
Summary of ChangesHello @mohamedawnallah, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the robustness of the TLS manager by addressing an edge case where the system might not correctly regenerate a TLS certificate and key pair if only one of the two required files (certificate or key) was present. The updated logic ensures that in such 'partial file' scenarios, a new, complete, and valid TLS pair is generated, thereby improving the reliability of TLS setup and preventing potential connection issues. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly addresses an issue where lnd would fail to start if only one of the TLS certificate or key files were present. The logic change in generateCertPair to use && instead of || is the right fix. The addition of TestGenerateCertPairWithPartialFiles is great for ensuring this case is covered and prevents regressions. I've suggested a small refactoring for the new test to improve its structure and maintainability by making it table-driven, which is also a preferred style in this repository.
When there is only one of the tls pairs (key/certificate) and the other is missing, the TLS manager currently assumes it exists and ignore generating them. This results in error propgated to user that the other tls pair file is missing/not found.
4a5acd6 to
c7fe642
Compare
Change Description
When there is only one of the tls pairs (key/certificate) and the other is missing, the TLS manager currently assumes it exists and ignore generating them. This results in error propgated to user that the other tls pair file is missing/not found.
lnd/tls_manager.go
Lines 210 to 254 in 85a5bf2
Closes #10392.
Steps to Test
Steps for reviewers to follow to test the change.
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.