Skip to content

crypto/tls: handshake error with custom/local CA (bad record MAC & certificate signed by unknown authority) #4728

Description

@gopherbot

by hanks_j@ligo-wa.caltech.edu:

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.

1. Setup a web-server serving https with a certificate from a local CA

2. Point the program listed at http://play.golang.org/p/iKScTFUQl3 at the server

3. The program is unable to complete the TLS handshake.

What is the expected output?

The program should complete a TLS handshake and exit without errors.

What do you see instead?

Two error conditions:
 1. if certificate verification is enabled, it states that the certificate is signed by an unknown authority
 2. if certificate verification is disabled, it states that there is a bad record MAC.

I have verified that the certificate chain is complete, that the certificate and key are
the correct pair.

Which compiler are you using (5g, 6g, 8g, gccgo)?

gc

Which operating system are you using?

Ubuntu 10.04 amd 64bit
Debian 6 amd 64bit

Which version are you using?  (run 'go version')

Tested on 1.0.2, 1.0.3, tip

Please provide any additional information below.

This could be a problem with my CA setup.  However the CA and the test web server
satisfy both gnutls and openssl.  Both report the certificate chain as being valid.  I
can make the connection with anything else.

I have attached a sample certificate, key, and ca certificate that I tested against.  It
is a horribly weak key.  However key length does not seem to change the outcome.  I have
tested this with 512 bit and 2048 bit rsa keys.

I ran into this issue while attempting to consume a https resource in a program I am
working on.

Attachments:

  1. server1_cert.pem (1018 bytes)
  2. server1_key.pem (493 bytes)
  3. ca-cert.pem (855 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions