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

x/crypto/acme/autocert: Document key generation with a non-nil acme.Client #22064

Closed
takeyourhatoff opened this issue Sep 27, 2017 · 1 comment

Comments

@takeyourhatoff
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.9

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

What did you do?

Read documentation at https://godoc.org/golang.org/x/crypto/acme/autocert#Manager.

What did you expect to see?

Regarding the Client field, I expected the behaviour here:

client := m.Client
if client == nil {
	client = &acme.Client{DirectoryURL: acme.LetsEncryptURL}
}
if client.Key == nil {
	var err error
	client.Key, err = m.accountKey(ctx)
	if err != nil {
		return nil, err
	}
}

To be documented, with something along the lines of:

// If Client is nil, a zero-value acme.Client is used with acme.LetsEncryptURL
// directory endpoint.
// Then, if Client.Key is nil, a newly-generated ECDSA P-256 key is used.

What did you see instead?

// If Client is nil, a zero-value acme.Client is used with acme.LetsEncryptURL
// directory endpoint and a newly-generated ECDSA P-256 key.

Note that the current documentation implies that:

m := autocert.Manager{
	Client: &acme.Client{DirectoryURL: "http://example.com"},
}

Is incorrect as the documentation for acme.Client states:

Client is an ACME client. The only required field is Key.

The autocert package helpfully generates a key for you and fills in the Key field, allowing you to specify an alternative DirectoryURL without having to generate a key yourself.

@gopherbot gopherbot added this to the Unreleased milestone Sep 27, 2017
@FiloSottile FiloSottile changed the title x/acme/autocert: Document key generation with a non-nil acme.Client x/crypto/acme/autocert: Document key generation with a non-nil acme.Client Apr 17, 2018
@gopherbot
Copy link

Change https://golang.org/cl/115937 mentions this issue: acme/autocert: update Manager.Client and Cache docs

@golang golang locked and limited conversation to collaborators Jun 6, 2019
c-expert-zigbee pushed a commit to c-expert-zigbee/crypto_go that referenced this issue Mar 28, 2022
Fixes golang/go#22064

Change-Id: Icb3f5b2c1967630a3dcbd9661b3492f5d3acc654
Reviewed-on: https://go-review.googlesource.com/115937
Reviewed-by: Alex Vaghin <ddos@google.com>
c-expert-zigbee added a commit to c-expert-zigbee/crypto_go that referenced this issue Mar 29, 2022
Fixes golang/go#22064

Change-Id: Icb3f5b2c1967630a3dcbd9661b3492f5d3acc654
Reviewed-on: https://go-review.googlesource.com/115937
Reviewed-by: Alex Vaghin <ddos@google.com>
c-expert-zigbee added a commit to c-expert-zigbee/crypto_go that referenced this issue Mar 29, 2022
Fixes golang/go#22064

Change-Id: Icb3f5b2c1967630a3dcbd9661b3492f5d3acc654
Reviewed-on: https://go-review.googlesource.com/115937
Reviewed-by: Alex Vaghin <ddos@google.com>
LewiGoddard pushed a commit to LewiGoddard/crypto that referenced this issue Feb 16, 2023
Fixes golang/go#22064

Change-Id: Icb3f5b2c1967630a3dcbd9661b3492f5d3acc654
Reviewed-on: https://go-review.googlesource.com/115937
Reviewed-by: Alex Vaghin <ddos@google.com>
BiiChris pushed a commit to BiiChris/crypto that referenced this issue Sep 15, 2023
Fixes golang/go#22064

Change-Id: Icb3f5b2c1967630a3dcbd9661b3492f5d3acc654
Reviewed-on: https://go-review.googlesource.com/115937
Reviewed-by: Alex Vaghin <ddos@google.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants