fix(openvpn): bundle provider CA certificates in one block (#3258)

This commit is contained in:
Michael Bisbjerg
2026-03-26 22:32:43 +01:00
committed by GitHub
parent 086e3740f3
commit 5b88c76a14
2 changed files with 53 additions and 8 deletions
+38
View File
@@ -0,0 +1,38 @@
package utils
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestWrapOpenvpnCAs(t *testing.T) {
t.Parallel()
lines := WrapOpenvpnCAs([]string{"cert1", "cert2"})
assert.Equal(t, []string{
"<ca>",
"-----BEGIN CERTIFICATE-----",
"cert1",
"-----END CERTIFICATE-----",
"-----BEGIN CERTIFICATE-----",
"cert2",
"-----END CERTIFICATE-----",
"</ca>",
}, lines)
}
func TestWrapOpenvpnCA(t *testing.T) {
t.Parallel()
lines := WrapOpenvpnCA("cert1")
assert.Equal(t, []string{
"<ca>",
"-----BEGIN CERTIFICATE-----",
"cert1",
"-----END CERTIFICATE-----",
"</ca>",
}, lines)
}