TLS with selfsigned certificate

I’m trying to establish a TLS connection with the use of a self signed server certificate.

I generated the certificate with this example code:

My relevant client code looks like that:

// server cert is self signed -> server_cert == ca_cert
CA_Pool := x509.NewCertPool()
severCert, err := ioutil.ReadFile("./cert.pem")
if err != nil {
    log.Fatal("Could not load server certificate!")

config := tls.Config{RootCAs: CA_Pool}

conn, err := tls.Dial("tcp", "", &config)
if err != nil {
    log.Fatalf("client: dial: %s", err)

And the relevant server code like that:

cert, err := tls.LoadX509KeyPair("./cert.pem", "./key.pem")
config := tls.Config{Certificates: []tls.Certificate{cert}}
listener, err := tls.Listen("tcp", "", &config)

for {
    conn, err := listener.Accept()
    if err != nil {
        log.Printf("server: accept: %s", err)
    log.Printf("server: accepted from %s", conn.RemoteAddr())
    go handleConnection(conn)

Because the server certificate is self signed is use the same certificate for the server and the clients CA_Pool however this does not seem to work since i always get this error:

client: dial: x509: certificate signed by unknown authority 
(possibly because of "x509: invalid signature: parent certificate
cannot sign this kind of certificate" while trying to verify 
candidate authority certificate "serial:0")

What’s my mistake?