fixed a few stuff

This commit is contained in:
yusing
2025-02-10 13:05:21 +08:00
parent 73e2660e59
commit 2c57e439d5
11 changed files with 108 additions and 24 deletions

View File

@@ -0,0 +1,19 @@
package certs
import (
"testing"
. "github.com/yusing/go-proxy/internal/utils/testing"
)
func TestZipCert(t *testing.T) {
ca, crt, key := []byte("test1"), []byte("test2"), []byte("test3")
zipData, err := ZipCert(ca, crt, key)
ExpectNoError(t, err)
ca2, crt2, key2, err := ExtractCert(zipData)
ExpectNoError(t, err)
ExpectBytesEqual(t, ca, ca2)
ExpectBytesEqual(t, crt, crt2)
ExpectBytesEqual(t, key, key2)
}