mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 00:17:34 +02:00
config: use getters for certificates (#2001)
* config: use getters for certificates * update log message
This commit is contained in:
parent
36eeff296a
commit
853d2dd478
8 changed files with 101 additions and 51 deletions
|
@ -228,21 +228,20 @@ func (a *Authorize) getEvaluatorRequestFromCheckRequest(
|
|||
|
||||
func (a *Authorize) getDownstreamClientCA(policy *config.Policy) (string, error) {
|
||||
options := a.currentOptions.Load()
|
||||
switch {
|
||||
case policy != nil && policy.TLSDownstreamClientCA != "":
|
||||
|
||||
if policy != nil && policy.TLSDownstreamClientCA != "" {
|
||||
bs, err := base64.StdEncoding.DecodeString(policy.TLSDownstreamClientCA)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(bs), nil
|
||||
case options.ClientCA != "":
|
||||
bs, err := base64.StdEncoding.DecodeString(options.ClientCA)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(bs), nil
|
||||
}
|
||||
return "", nil
|
||||
|
||||
ca, err := options.GetClientCA()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(ca), nil
|
||||
}
|
||||
|
||||
func (a *Authorize) getMatchingPolicy(requestURL url.URL) *config.Policy {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue