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

load TLS certificate from file #22

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
added KeyFile to servers
  • Loading branch information
jbsv committed Nov 18, 2024
commit c6f065c103ebe7bbe530109e8a9a368f5b6fe340
2 changes: 1 addition & 1 deletion cmd/grpc/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func main() {
runtime.GC()

// run server with TLS
creds, err := credentials.NewClientTLSFromFile(config.CertFile, "")
creds, err := credentials.NewServerTLSFromFile(config.CertFile, config.KeyFile)
if err != nil {
log.Fatalf("failed to load servers certificates: %v", err)
}
Expand Down
1 change: 1 addition & 0 deletions lib/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Config struct {
Addresses []string

CertFile string
KeyFile string
}

type Server struct {
Expand Down