mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-29 08:57:18 +02:00
authorize: do not rely on Envoy client cert validation (#4438)
Partially revert #4374: do not record the peerCertificateValidated() result as reported by Envoy, as this does not work correctly for resumed TLS sessions. Instead always record the certificate chain as presented by the client. Remove the corresponding ClientCertificateInfo Validated field, and update affected code accordingly. Skip the CRL integration test case for now.
This commit is contained in:
parent
465de43e67
commit
e91600c158
9 changed files with 12 additions and 69 deletions
|
@ -107,25 +107,14 @@ func Test_isValidClientCertificate(t *testing.T) {
|
|||
t.Run("valid cert", func(t *testing.T) {
|
||||
valid, err := isValidClientCertificate(testCA, ClientCertificateInfo{
|
||||
Presented: true,
|
||||
Validated: true,
|
||||
Leaf: testValidCert,
|
||||
})
|
||||
assert.NoError(t, err, "should not return an error")
|
||||
assert.True(t, valid, "should return true")
|
||||
})
|
||||
t.Run("cert not externally validated", func(t *testing.T) {
|
||||
valid, err := isValidClientCertificate(testCA, ClientCertificateInfo{
|
||||
Presented: true,
|
||||
Validated: false,
|
||||
Leaf: testValidCert,
|
||||
})
|
||||
assert.NoError(t, err, "should not return an error")
|
||||
assert.False(t, valid, "should return false")
|
||||
})
|
||||
t.Run("unsigned cert", func(t *testing.T) {
|
||||
valid, err := isValidClientCertificate(testCA, ClientCertificateInfo{
|
||||
Presented: true,
|
||||
Validated: true,
|
||||
Leaf: testUnsignedCert,
|
||||
})
|
||||
assert.NoError(t, err, "should not return an error")
|
||||
|
@ -134,7 +123,6 @@ func Test_isValidClientCertificate(t *testing.T) {
|
|||
t.Run("not a cert", func(t *testing.T) {
|
||||
valid, err := isValidClientCertificate(testCA, ClientCertificateInfo{
|
||||
Presented: true,
|
||||
Validated: true,
|
||||
Leaf: "WHATEVER!",
|
||||
})
|
||||
assert.Error(t, err, "should return an error")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue