-
Notifications
You must be signed in to change notification settings - Fork 190
Add TLS example under examples/doc-examples (follow-up to PR #831) #978
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: main
Are you sure you want to change the base?
Conversation
|
@yashksaini-coder : Thank you so much to you and @Fatumayattani for your efforts. Appreciate it. It took me sometime to reach this PR as there were close to 12+ PRs in the review queue. Did re-run the CI/CD pipeline. Waiting for the test results. Wish if you could collaborate with @Fatumayattani and arrive at a good conclusion on this PR soon. We need a proper screencast demonstrating the example using TLS along with proper documentation to enable interop testing using TLS. CCing @acul71, who could help you on the transport interop testing front using TLS example. |
ping me when is merged, I'll try to integrate in interop-tests |
|
Thank you @seetadev and @acul71 for the feedback and clear guidance 🙏 Here’s the screencast showing the TLS example running successfully libv.mp4@yashksaini-coder , please feel free to add the documentation part to make it easier to use for interop testing 🙏 |
Got it, I will add the documentation along with discussion post to map the implementation done |
Hi @Fatumayattani thanks for the video. Is that showing a python server ? Is there a client also ? |
Hi @acul71, yes that’s the server side. I’ll add a simple client example too to make interop testing smoother 🙌🏽 |
…; add argument parsing for host and port configuration.
…hance message handling and argument parsing
…ve error handling and logging in read_data function
… up imports and formatting
…mal binding addresses; improve connection handling in TLSReadWriter class to manage closed connections more effectively.
… code and improve clarity.
|
@yashksaini-coder : Thank you so much for considering our feedback points. Appreciate the efforts. Re-ran the CI/CD pipeline. Hopefully, all the tests should pass. CCing @acul71, who could use this example for testing transport interop tests. |
|
@yashksaini-coder : Wish if you could resolve the CI/CD issues. |
…le scripts; improve certificate verification docstring formatting
All issues resolved, failing ci-checks. Requesting an update and further feedback. |
|
@yashksaini-coder @Fatumayattani AI Pull Request Review: #978PR Title: Add TLS example under examples/doc-examples (follow-up to PR #831) 1. Summary of ChangesThis PR adds TLS example implementations to demonstrate how to use TLS-secured connections in py-libp2p. The PR is a follow-up to PR #831 (which added TLS transport support) and addresses the need for simple, runnable examples that developers can use to verify TLS functionality. Issues Addressed
Files Changed
Architecture Impact
Breaking ChangesNone - This is an additive change that only adds examples and optional development-mode features. 2. Branch Sync Status and Merge ConflictsBranch Sync Status
Merge Conflict Analysis
3. Strengths
4. Issues FoundCriticalNone identified. Major4.1 Missing Newsfragment
4.2 Test Failure: Address Paradigm Not Used in Client Example
4.3 Linting Errors: Line Too Long
4.4 Debug Print Statements in Production Code
4.5 Development Mode in Certificate Verification
Minor4.6 Unused Import Removed by Linter
4.7 Variable Name Shadowing
4.8 Inconsistent Error Handling
5. Security ReviewSecurity Concerns5.1 Development Mode Security Risk
5.2 Print Statements May Leak Sensitive Information
5.3 Certificate Verification Bypass Logic
Positive Security Aspects
6. Documentation and ExamplesStrengths
Issues
7. Newsfragment RequirementMissing Newsfragment
Issue Reference Verification
8. Tests and ValidationTest Results Summary
Test Failures8.1
|
What was wrong?
Issue #700 follow-up. After @guha-rahul’s TLS (PR #831) was merged, there was still no simple runnable example demonstrating how to start a TLS-enabled host in py-libp2p.
Developers needed a small working reference to verify that the new transport layer functions as expected.
How was it fixed?
Added a short example under
examples/doc-examples/example_tls.pythat demonstrates how to create and start a TLS-secured host usingTLSTransport.The example runs locally, prints the peer ID, and lists the secure multiaddrs for verification.
To-Do
examples/doc-examplesOutput
TLS host starts successfully with secure addresses and confirms that TLS handshake is active.
A sample terminal output is attached below for reference.
Cute Animal Picture