package main
import (
"log"
"github.com/kintsdev/certy"
)
func main() {
// Create a new certificate manager
manager := certy.NewManager(
"[email protected]", // Your email for Let's Encrypt
"./certs", // Directory to store certificates
true, // Use staging environment first
)
// Issue a certificate for a domain
err := manager.IssueCert("example.com")
if err != nil {
log.Fatalf("Failed to issue certificate: %v", err)
}
}
Everything you need for automated Let's Encrypt certificate lifecycle — from issuing to renewal.
Issue and renew SSL certificates automatically via Let's Encrypt. Production and staging environment support out of the box.
Built-in ACME challenge handler for domain verification. Just wrap your HTTP handler and Let's Encrypt validates automatically.
Add your own PEM certificates alongside Let's Encrypt ones. Use AddCustomCert() with cert and key data.
Concurrent certificate issuance with proper mutex locking. Safe to use across multiple goroutines without data races.
Certificates are renewed 30 days before expiry automatically. ECDSA P-256 keys, RSA 4096-bit account keys, 88-day cert lifetime.
Test with Let's Encrypt staging servers first. 300 new orders per 3 hours — switch to production when you're ready.
Run go get github.com/kintsdev/certy to add Certy to your Go project.
Call NewManager(email, path, staging) then IssueCert(domain).
Use GetCert in your TLS config and wrap with HTTPHandler for challenges.
Drop Certy into any Go HTTP server. Use GetCert for automatic certificate selection and HTTPHandler for ACME challenge handling.
GetCertificate callbackAddCustomCert(domain, cert, key)manager := certy.NewManager(
"[email protected]", "./certs", false,
)
server := &http.Server{
Addr: ":8443",
TLSConfig: &tls.Config{
GetCertificate: manager.GetCert,
},
Handler: http.HandlerFunc(
func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello from %s!", r.Host)
},
),
}
// Wrap with ACME challenge handler
server.Handler = manager.HTTPHandler(server.Handler)
log.Fatal(server.ListenAndServeTLS("", ""))
Automatic Let's Encrypt certificates with HTTP-01 challenges, auto-renewal, and thread-safe design. Open source, production ready.