Skip to content

Commit

Permalink
feat: log if WithCAEndpoint(DefaultCATestEndpoint) (#33)
Browse files Browse the repository at this point in the history
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 <1992255+2color@users.noreply.github.com>
  • Loading branch information
lidel and 2color authored Jan 13, 2025
1 parent f667e81 commit 41ec946
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/acme.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ func NewP2PForgeCertMgr(opts ...P2PForgeCertMgrOptions) (*P2PForgeCertMgr, error
}
if mgrCfg.caEndpoint == "" {
mgrCfg.caEndpoint = DefaultCAEndpoint
} else if mgrCfg.caEndpoint == DefaultCATestEndpoint {
mgrCfg.log.Errorf("initialized with staging endpoint (%s): certificate won't work correctly in web browser; make sure to change to WithCAEndpoint(DefaultCAEndpoint) (%s) before deploying to production or testing in web browser", DefaultCATestEndpoint, DefaultCAEndpoint)
}
if mgrCfg.forgeRegistrationEndpoint == "" {
if mgrCfg.forgeDomain == DefaultForgeDomain {
Expand Down

0 comments on commit 41ec946

Please sign in to comment.