Allow multiple certificates per file in x509_cert input (#6695)
This commit is contained in:
committed by
Daniel Nelson
parent
c16b760a26
commit
c53d53826d
@@ -141,6 +141,14 @@ func TestGatherLocal(t *testing.T) {
|
||||
{name: "not a certificate", mode: 0640, content: "test", error: true},
|
||||
{name: "wrong certificate", mode: 0640, content: wrongCert, error: true},
|
||||
{name: "correct certificate", mode: 0640, content: pki.ReadServerCert()},
|
||||
{name: "correct certificate and extra trailing space", mode: 0640, content: pki.ReadServerCert() + " "},
|
||||
{name: "correct certificate and extra leading space", mode: 0640, content: " " + pki.ReadServerCert()},
|
||||
{name: "correct multiple certificates", mode: 0640, content: pki.ReadServerCert() + pki.ReadCACert()},
|
||||
{name: "correct certificate and wrong certificate", mode: 0640, content: pki.ReadServerCert() + "\n" + wrongCert, error: true},
|
||||
{name: "correct certificate and not a certificate", mode: 0640, content: pki.ReadServerCert() + "\ntest", error: true},
|
||||
{name: "correct multiple certificates and extra trailing space", mode: 0640, content: pki.ReadServerCert() + pki.ReadServerCert() + " "},
|
||||
{name: "correct multiple certificates and extra leading space", mode: 0640, content: " " + pki.ReadServerCert() + pki.ReadServerCert()},
|
||||
{name: "correct multiple certificates and extra middle space", mode: 0640, content: pki.ReadServerCert() + " " + pki.ReadServerCert()},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
||||
Reference in New Issue
Block a user