final class Builder (View source)

SSLOptions builder allows fluent configuration of ssl options.

Methods

build()

Builds SSL options.

withTrustedCerts(string ...$path)

Adds a trusted certificate. This is used to verify node's identity.

withVerifyFlags(int $flags)

Disable certificate verification.

withClientCert(string $path)

Set client-side certificate chain.

withPrivateKey(string $path, string|null $passphrase)

Set client-side private key. This is used to authenticate the client on the server-side.

Details

SSLOptions build()

Builds SSL options.

Return Value

SSLOptions

ssl options configured accordingly.

Builder withTrustedCerts(string ...$path)

Adds a trusted certificate. This is used to verify node's identity.

Parameters

string ...$path

one or more paths to files containing a PEM formatted certificate.

Return Value

Builder self

Exceptions

InvalidArgumentException

Builder withVerifyFlags(int $flags)

Disable certificate verification.

Parameters

int $flags

Return Value

Builder self

Exceptions

InvalidArgumentException

Builder withClientCert(string $path)

Set client-side certificate chain.

This is used to authenticate the client on the server-side. This should contain the entire Certificate chain starting with the certificate itself.

Parameters

string $path

path to a file containing a PEM formatted certificate.

Return Value

Builder self

Exceptions

InvalidArgumentException

Builder withPrivateKey(string $path, string|null $passphrase)

Set client-side private key. This is used to authenticate the client on the server-side.

Parameters

string $path

Path to the private key file

string|null $passphrase

Passphrase for the private key, if any

Return Value

Builder self

Exceptions

InvalidArgumentException