2023-03-06 03:45:13 +00:00
|
|
|
// Copyright 2023 the Pinniped contributors. All Rights Reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
package tlsassertions
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2023-03-16 18:13:49 +00:00
|
|
|
func TestGetTLSErrorPrefix(t *testing.T) {
|
2023-03-06 03:45:13 +00:00
|
|
|
expected := "tls: failed to verify certificate: "
|
|
|
|
|
|
|
|
if strings.Contains(runtime.Version(), "1.19") {
|
|
|
|
expected = ""
|
|
|
|
}
|
|
|
|
|
2023-03-16 18:13:49 +00:00
|
|
|
require.Equal(t, expected, GetTLSErrorPrefix())
|
2023-03-06 03:45:13 +00:00
|
|
|
}
|