Skip to content
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

feat: add AutoTLS example #3103

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

feat: add AutoTLS example #3103

wants to merge 18 commits into from

Conversation

2color
Copy link
Contributor

@2color 2color commented Dec 17, 2024

This adds an example showing how to use the p2p-forge client library with the AutoTLS backend to issue a wild card certificate.

Credits to @guillaumemichel for writing the initial code in this example.

Fix before merging

  • The libp2p.direct address is not announced by the peer via identify, even though the peer has successfully minted a TLS certificate. Fixed by c16ebd9
  • Store peer identity on disk to avoid generating a new certificate on each run

examples/autotls/README.md Outdated Show resolved Hide resolved
@2color
Copy link
Contributor Author

2color commented Dec 19, 2024

@MarcoPolo Is it a problem this PR upgrades the go to 1.23 in go.mod?

I believe this happened due to dependency on p2p-forge

@2color 2color mentioned this pull request Dec 20, 2024
2 tasks
@2color 2color requested a review from lidel January 8, 2025 09:53
@guillaumemichel
Copy link
Contributor

ipshipyard/p2p-forge#29 should solve the build issue

@2color

This comment was marked as outdated.

this also passes correct logger so debug messages from
p2p-forge/client are printed correctly
@lidel lidel marked this pull request as draft January 8, 2025 18:07
examples/go.mod Outdated Show resolved Hide resolved
lidel added a commit to ipshipyard/p2p-forge that referenced this pull request Jan 8, 2025
this implements idea from
libp2p/go-libp2p#3103 (comment)
to ensure users who set up staging endpoint for testing
are always aware fo it and never ship it to production
@2color 2color marked this pull request as ready for review January 9, 2025 09:37
@guillaumemichel guillaumemichel self-requested a review January 9, 2025 16:34
@MarcoPolo
Copy link
Collaborator

@MarcoPolo Is it a problem this PR upgrades the go to 1.23 in go.mod?

I believe this happened due to dependency on p2p-forge

Yes. We can't do that until the Go team releases 1.24

lidel added a commit to ipshipyard/p2p-forge that referenced this pull request Jan 13, 2025
implements idea from libp2p/go-libp2p#3103 (comment)
to ensure users who set up staging endpoint for testing
are always aware fo it and never ship it to production
---------

Co-authored-by: Daniel Norman <[email protected]>
https://github.com/ipshipyard/p2p-forge/releases/tag/v0.2.2

main fix is ability to use the same go1.22 in examples as go-libp2p
itself
@lidel lidel force-pushed the add-autotls-example branch from 285d38f to 14e0d50 Compare January 13, 2025 22:16
@lidel
Copy link
Member

lidel commented Jan 13, 2025

Pushed update to p2p-forge/client v0.2.2.

It allows this PR to use the same go1.22 version in ./examples/go.mod as main go-libp2p in /go.mod.
Going forward, p2p-forge releases will aim to use same go version as go-libp2p to ensure users can try it without being forced to update go.

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.

6 participants