8000 Fix Go 1.10 build errors by cbroglie · Pull Request #863 · cloudflare/cfssl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix Go 1.10 build errors #863

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

Merged
merged 7 commits into from
Feb 23, 2018
Merged

Fix Go 1.10 build errors #863

merged 7 commits into from
Feb 23, 2018

Conversation

cbroglie
Copy link
Contributor
@cbroglie cbroglie commented Feb 23, 2018

Fixes #857 and #861.

Also includes switching to dep for dependency management.

@lziest
Copy link
Contributor
lziest commented Feb 23, 2018

LGTM


}

// NewBundlerFromPEM creates a new Bundler from PEM-encoded root certificates and
// intermediate certificates.
// If caBundlePEM is nil, the resulting Bundler can only do "Force" bundle.
func NewBundlerFromPEM(caBundlePEM, intBundlePEM []byte) (*Bundler, error) {
func NewBundlerFromPEM(caBundlePEM, intBundlePEM []byte, opt ...Option) (*Bundler, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure about the semantic of a list of opt functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is emerging as a common pattern for initializers in Go. Some background: https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis.

And my implementation was inspired (read: mostly copied) from gRPC: https://github.com/grpc/grpc-go/blob/583a6303969ea5075e9bd1dc4b75805dfe66989a/server.go#L328.

Copy link
Contributor

Choose a reason for hiding this comment

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

cool, I learn something new!

@cbroglie
Copy link
Contributor Author

The bundler related build failures are surprising to me, as the tests pass locally and some of them passed on Travis. I'm going to close and re-open this PR to trigger another Travis build.

@cbroglie cbroglie closed this Feb 23, 2018
@cbroglie cbroglie reopened this Feb 23, 2018
@cbroglie
Copy link
Contributor Author

Oh, duh. Of course this fixes the Go 1.10 builds but breaks the other versions.

As of Go 1.10 Certificate.Verify will check the allowed key usages for
the entire chain: https://golang.org/doc/go1.10#crypto/x509
@cbroglie
Copy link
Contributor Author

Ok, all the tests pass now (with the exception of the flapping macOS one).

@cbroglie cbroglie merged commit 4e2dcbd into master Feb 23, 2018
@cbroglie cbroglie deleted the cbroglie/go1.10 branch February 23, 2018 23:17
sigma added a commit to sigma/cfssl that referenced this pull request Jun 20, 2018
This is the first released version containing the change required in cloudflare#863
Added benefit: github.com/gogo/protobuf is not needed anymore.
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
0