Skip to content

Commit

Permalink
WIP embed: requests for grpc gateway must have empty CN if --client-c…
Browse files Browse the repository at this point in the history
…ert-auth is passed
  • Loading branch information
mitake committed Jan 3, 2019
1 parent 49c60fa commit 28265e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions embed/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,16 @@ func (ac *accessController) ServeHTTP(rw http.ResponseWriter, req *http.Request)
http.Error(rw, errCVE20185702(host), 421)
return
}
} else if ac.s.Cfg.ClientCertAuthEnabled {
for _, chains := range req.TLS.VerifiedChains {
if len(chains) < 1 {
continue
}
if len(chains[0].Subject.CommonName) != 0 {
http.Error(rw, "client sending requests against gateway must have empty CommonName in its cert", 400)
return
}
}
}

// Write CORS header.
Expand Down

0 comments on commit 28265e7

Please sign in to comment.