Skip to content

crypto/x509: "certificate signed by unknown authority" with seemingly valid certificate chain #28276

Description

@imirkin

Version: go version go1.11.1 linux/amd64

Trying to fetch any data from https://www.aft.gouv.fr/ results in an error, but chrome and openssl s_client are both happy. Checked that there's a Certigna CA root in my /etc/ssl/certs (which is the ultimate root presented by this site). One odd observation is that the serial number in chrome has an extra leading 00 byte compared to what "openssl x509 -text" prints for that certificate. I can see the execution do "openat" syscalls on all the /etc/ssl/certs files (the "correct" cert is e113c810.0 aka "Certigna" -- openssl only opens that one file).

~ $ mkdir go-1.11.1
~ $ cd go-1.11.1/
~/go-1.11.1 $ mv ../go1.11.1.linux-amd64.tar.gz .
~/go-1.11.1 $ tar zxf go1.11.1.linux-amd64.tar.gz 
~/go-1.11.1 $ GOPATH=`pwd` ./go/bin/go version
go version go1.11.1 linux/amd64
~/go-1.11.1 $ GOPATH=`pwd` ./go/bin/go run tt.go 
Get https://www.aft.gouv.fr/: x509: certificate signed by unknown authority
$ cat tt.go
package main

import (
        "fmt"
        "net/http"
)

func main() {
        _, err := http.Get("https://www.aft.gouv.fr/")
        if err != nil {
                fmt.Println(err)
        } else {
                fmt.Println("success")
        }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions