Skip to content

api: Add SetRootCAsFromPEM method#3972

Open
prziborowski wants to merge 1 commit into
vmware:mainfrom
prziborowski:main
Open

api: Add SetRootCAsFromPEM method#3972
prziborowski wants to merge 1 commit into
vmware:mainfrom
prziborowski:main

Conversation

@prziborowski

Copy link
Copy Markdown
Contributor

Add SetRootCAsFromPEM to allow passing in-memory PEM-encoded certificates instead of requiring them to be on disk. This is useful for read-only filesystems where CA contents are already available in memory.

Description

Add SetRootCAsFromPEM to allow passing in-memory PEM-encoded
certificates instead of requiring them to be on disk. This is
useful for read-only filesystems where CA contents are already
available in memory.

How Has This Been Tested?

Tested with a container doing:

	if len(config.CAContents) != 0 {
		if err = soapClient.SetRootCAsFromPEM([][]byte{config.CAContents}); err != nil {
			return fmt.Errorf("failed to set root CA %s: %w", config.CAFilePath, err)
		}
	}

and was able to connect to vCenter properly.

Guidelines

Please read and follow the CONTRIBUTION guidelines of this project.

Add SetRootCAsFromPEM to allow passing in-memory PEM-encoded
certificates instead of requiring them to be on disk. This is
useful for read-only filesystems where CA contents are already
available in memory.

Signed-off-by: Nathan Prziborowski <prziborowski@gmail.com>
@prziborowski prziborowski marked this pull request as ready for review March 2, 2026 17:46

@hickeng hickeng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Up to @prziborowski whether to change validation of empty slice or not.

Comment thread vim25/soap/client_test.go
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.

2 participants