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

Add support for SHA256 thumbprint based vCenter authentication #3384

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

dougm
Copy link
Member

@dougm dougm commented Mar 11, 2024

vSphere in general is moving from SHA1 to SHA256 based TLS certificate thumbprints. This change allows use of SHA256 thumbprint when connecting to vCenter.

govc: the about.cert command '-thumbprint' flag now outputs SHA256 instead of SHA1

@dougm
Copy link
Member Author

dougm commented Mar 11, 2024

Existing test coverage here:

run govc about -k=false -tls-known-hosts <(echo "$thumbprint")

Manual version of that test:

% govc about.cert | grep Thumbprint
Thumbprints:                 
  SHA-256 Thumbprint:        D2:87:1C:36:1A:1C:88:AA:8E:14:14:4D:1E:6A:96:94:B3:D5:86:DF:5D:D3:AE:D3:BA:CC:D3:BA:8C:36:B4:35
  SHA-1 Thumbprint:          3D:20:E1:A4:24:69:61:06:FF:A4:F1:8A:85:38:3B:E4:5D:66:2D:5E

% govc about.cert -k=true -thumbprint | tee .govc_known_hosts
10.x.x.x D2:87:1C:36:1A:1C:88:AA:8E:14:14:4D:1E:6A:96:94:B3:D5:86:DF:5D:D3:AE:D3:BA:CC:D3:BA:8C:36:B4:35

% govc about -k=false
govc: Post "https://10.x.x.x.x/sdk#vcva70U3e": tls: failed to verify certificate: x509: “10.x.x.x.x” certificate is not trusted

% govc about -k=false -tls-known-hosts .govc_known_hosts 
FullName:     VMware vCenter Server 7.0.3 build-21958406
...

vSphere in general is moving from SHA1 to SHA256 based TLS certificate thumbprints.
This change allows use of SHA256 thumbprint when connecting to vCenter.

govc: the about.cert command '-thumbprint' flag now outputs SHA256 instead of SHA1
@dougm dougm force-pushed the thumbprint-sha256 branch from f7349c8 to 8bfb252 Compare March 11, 2024 22:07
@SandeepPissay
Copy link
Contributor

Looks good to me! Thanks @dougm for the quick turnaround.

/lgtm

@dougm dougm merged commit d62c0ac into vmware:main Mar 11, 2024
10 checks passed
@dougm dougm deleted the thumbprint-sha256 branch March 11, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants