Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose the peer certificates in the connection state #162

Closed

Conversation

marten-seemann
Copy link
Collaborator

@marten-seemann marten-seemann commented Jan 11, 2018

The ConnectionState.PeerCertificates is now filled with the certificate chain that the peer sent. This works for both the server as well as the client.

Note that this PR is unrelated to #161. The certificate chain exposed via ConnectionState.PeerCertificates is just what the peer sent.

@ekr: This was marked as a TODO for you in the code, so I guess you'll have the most context to review this PR, right?

@marten-seemann
Copy link
Collaborator Author

@ekr, @bifurcation: Any thoughts on this PR?

Copy link
Collaborator

@ekr ekr left a comment

Choose a reason for hiding this comment

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

Does the validator do path construction? IF so, the list you are supplying here may be incorrect and you might want to instead just return the EE cert.

serverCertChain := make([]*x509.Certificate, len(state.serverCertificate.CertificateList))
for i, certEntry := range state.serverCertificate.CertificateList {
serverCertChain[i] = certEntry.CertData
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the certificate authenticator do path construction?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure I understand your point. Certificate verification is broken anyway (#161).

conn_test.go Outdated
if err != nil {
panic(err)
}
clientKey, clientCert, err = genCerts()
Copy link
Collaborator

Choose a reason for hiding this comment

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

You probably don't want this to use the server name.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you use newSelfSigned()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@ekr
Copy link
Collaborator

ekr commented Jan 29, 2018 via email

@marten-seemann
Copy link
Collaborator Author

I don't think we can do this change without fixing #161. I'll submit a PR for #161 very soon, and I hope we can move forward with this quickly. This is a blocking issue for me currently, since I need a way to authenticate the peer.

@bifurcation
Copy link
Owner

Closing in favor of #173

@bifurcation bifurcation closed this Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants