Skip to content

Commit 41ec946

Browse files
lidel2color
andauthored
feat: log if WithCAEndpoint(DefaultCATestEndpoint) (#33)
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]>
1 parent f667e81 commit 41ec946

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

client/acme.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ func NewP2PForgeCertMgr(opts ...P2PForgeCertMgrOptions) (*P2PForgeCertMgr, error
241241
}
242242
if mgrCfg.caEndpoint == "" {
243243
mgrCfg.caEndpoint = DefaultCAEndpoint
244+
} else if mgrCfg.caEndpoint == DefaultCATestEndpoint {
245+
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)
244246
}
245247
if mgrCfg.forgeRegistrationEndpoint == "" {
246248
if mgrCfg.forgeDomain == DefaultForgeDomain {

0 commit comments

Comments
 (0)