Skip to content

Conversation

Fatumayattani
Copy link

What was wrong?

Issue #700 – Missing documentation on enabling, configuring, and testing TLS in py-libp2p.

How was it fixed?

Added a new TLS documentation file under docs/tls-support.rst that covers:

  • Overview of TLS in py-libp2p
  • Installation and configuration steps
  • Example Python code for TLS-enabled nodes
  • Certificate management guidance
  • Testing instructions for local and cross-implementation setups
  • Troubleshooting tips

To-Do

  • Review for clarity, completeness, and accuracy
  • Suggest additional sections or details if needed
  • Confirm that formatting renders correctly in the documentation site
  • Add/update release notes entry (newsfragments)

@acul71
Copy link
Contributor

acul71 commented Aug 16, 2025

@Fatumayattani

checking consistency... /home/docs/checkouts/readthedocs.org/user_builds/py-libp2p/checkouts/844/docs/tls-support.rst: WARNING: document isn't included in any toctree

you need to add the new tls-support.rst to toctree file

@Fatumayattani
Copy link
Author

@acul71
Thanks for the feedback!
I’ve added tls-support.rst to the toctree as suggested. The warning should now be resolved. 🙏

@seetadev
Copy link
Contributor

@Fatumayattani , @acul71 : Thank you so much for the effort on TLS documentation. Please resolve the CI/CD issues.

CCing @guha-rahul , who is actively working on introducing TLS and AutoTLS module in py-libp2p.

@acul71
Copy link
Contributor

acul71 commented Aug 18, 2025

Please resolve the CI/CD issues.

@Fatumayattani
Just run make pr (will do pr: clean fix lint typecheck test )
The file docs/tls-support.rst will be linted
then do git add docs/tls-support.rst and git commit

Git Diff Output

diff --git a/docs/tls-support.rst b/docs/tls-support.rst
index 3d9de53..aee3f00 100644
--- a/docs/tls-support.rst
+++ b/docs/tls-support.rst
@@ -1,4 +1,4 @@
-Py-libp2p – TLS Support Documentation 
+Py-libp2p – TLS Support Documentation
 ======================================================
 
 .. contents::
@@ -159,7 +159,3 @@ Troubleshooting
   * - Connection refused
     - Port blocked or listener not running
     - Check firewall rules and listener status.
-
-
-
-

Explanation

The diff shows minor formatting changes to docs/tls-support.rst:

  • Removed trailing space from title
  • Removed unnecessary empty lines at file end


.. code-block:: python

import asyncio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fatumayattani
Even if's ok, usually we use Trio instead of asyncio
consider using it, you can see examples in /examples directory

Enabling TLS in py-libp2p
-------------------------

**Working example – Listener and Dialer**
Copy link
Contributor

@acul71 acul71 Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional:
If you want you can add the example in the examples/ directory https://github.com/libp2p/py-libp2p/tree/main/examples
and include that in tls-support.rst see https://github.com/libp2p/py-libp2p/blob/main/docs/examples.identify.rst

@Fatumayattani
Copy link
Author

@seetadev Thanks for pointing that out 🙏 I’ll run make pr to address linting and type checks, and push the updated commit. Appreciate the guidance on keeping docs consistent.
@acul71 Many thanks for the helpful pointers 🙏. I’ll make sure to run the CI/CD checks as suggested to keep things clean, and I really like the idea of adding the listener/dialer example under /examples and linking it in the docs. That will definitely make the TLS guide clearer and more practical. Appreciate the guidance and support! ✨

@seetadev
Copy link
Contributor

@Fatumayattani : The correct PR is #831.

@seetadev
Copy link
Contributor

@Fatumayattani : The correct PR is #831.

@guha-rahul is maintaining the PR. The older PR had to be closed in favor of #831.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants