Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ jobs:
fail-fast: false
matrix:
postgres:
- '15'
- '14'
- '13'
- '12'
- '11'
- '10'
- '9.6'
go:
- '1.20'
- '1.19'
- '1.18'
- '1.17'
- '1.16'
- '1.15'
- '1.14'
steps:
- name: setup postgres pre-reqs
run: |
Expand Down Expand Up @@ -169,10 +169,10 @@ jobs:
docker exec pg createuser -h localhost -U postgres -DRS pqgosslcert

- name: check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: set up go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
id: go
Expand Down
8 changes: 8 additions & 0 deletions ssl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"crypto/tls"
"crypto/x509"
"database/sql"
"errors"
"fmt"
"io"
"net"
Expand Down Expand Up @@ -86,6 +87,10 @@ func TestSSLVerifyFull(t *testing.T) {
if err == nil {
t.Fatal("expected error")
}
// in Go 1.20 the error is wrapped in tls.CertificateVerificationError
if errWrapped := errors.Unwrap(err); errWrapped != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this use errors.As so that the test also checks that the outer error is CertificateVerificationError?

err = errWrapped
}
_, ok := err.(x509.UnknownAuthorityError)
if !ok {
_, ok := err.(x509.HostnameError)
Expand All @@ -101,6 +106,9 @@ func TestSSLVerifyFull(t *testing.T) {
if err == nil {
t.Fatal("expected error")
}
if errWrapped := errors.Unwrap(err); errWrapped != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and similar for here

err = errWrapped
}
_, ok = err.(x509.HostnameError)
if !ok {
t.Fatalf("expected x509.HostnameError, got %#+v", err)
Expand Down