I suspect your (possibly wrapped) error will be of type
x509.UnknownAuthorityError, so you should be able to check for it with
errors.As:

var uaerr x509.UnknownAuthorityError
if errors.As(err, &uaerr) {
  // handle as an unknown authority error
}

On Tue, Jun 2, 2020 at 8:22 AM Kevin Chadwick <m8il1i...@gmail.com> wrote:

> I want my client application to behave differently depending upon whether
> the
> server is down or it is a "x509: certificate signed by unknown authority"
> condition.
>
> It seems there isn't an errors.Is (btw the dot syntax makes it difficult to
> google search!)
>
> I intend to just string match the returned error. However, as it isn't a
> pkg
> variable (had to grep). Does the string fall outside the compatibility
> promise?
>
> If so. Is there a better way or should I just create a test to run on every
> stdlib upgrade?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/f4ddc813-ade5-7501-4fb4-d19dba375a4f%40gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CALRNMm0JUKmQ_bto3%2B1EpG4odzPYAr0Q%2BjYdytVmoQNp1Tn%3D8Q%40mail.gmail.com.

Reply via email to