Fix cert and key file mix up
Signed-off-by: Tamal Saha <tamal@appscode.com>
This commit is contained in:
parent
3947073b9e
commit
0ed4126240
@ -76,7 +76,7 @@ func loggingHandler(h http.Handler) http.Handler {
|
||||
}
|
||||
|
||||
// ListenAndServe serves the Clair v3 API over gRPC and the gRPC Gateway.
|
||||
func ListenAndServe(addr, keyFile, certFile, caPath string, store database.Datastore) error {
|
||||
func ListenAndServe(addr, certFile, keyFile, caPath string, store database.Datastore) error {
|
||||
srv := grpcutil.MuxedGRPCServer{
|
||||
Addr: addr,
|
||||
ServicesFunc: func(gsrv *grpc.Server) {
|
||||
|
@ -116,8 +116,14 @@ func (srv *MuxedGRPCServer) ListenAndServeTLS(certFile, keyFile, caPath string,
|
||||
if srv.TLSConfig == nil {
|
||||
srv.TLSConfig = &tls.Config{}
|
||||
}
|
||||
configureCA(srv.TLSConfig, caPath)
|
||||
configureCertificate(srv.TLSConfig, certFile, keyFile)
|
||||
err := configureCA(srv.TLSConfig, caPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = configureCertificate(srv.TLSConfig, certFile, keyFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
listener, err := tls.Listen("tcp", srv.Addr, srv.TLSConfig)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user