tuweni / org.apache.tuweni.net.tls / TrustManagerFactories / trustServerOnFirstUse

trustServerOnFirstUse

static fun trustServerOnFirstUse(knownServersFile: Path!): TrustManagerFactory! (source)

Accept CA-signed certificates, and otherwise trust server certificates on first use.

Except when a server presents a CA-signed certificate, on first connection to a server (identified by host+port) the fingerprint of the presented certificate will be recorded in knownServersFile. On subsequent connections, the presented certificate will be matched to the stored fingerprint to ensure it has not changed.

Parameters

knownServersFile - Path!: The path to the file containing fingerprints by host.

Return
TrustManagerFactory!: A trust manager factory.

static fun trustServerOnFirstUse(repository: FingerprintRepository!): TrustManagerFactory! (source)

Accept CA-signed certificates, and otherwise trust server certificates on first use.

Except when a server presents a CA-signed certificate, on first connection to a server (identified by host+port) the fingerprint of the presented certificate will be recorded in knownServersFile. On subsequent connections, the presented certificate will be matched to the stored fingerprint to ensure it has not changed.

Parameters

repository - FingerprintRepository!: The repository in which to record fingerprints by host.

Return
TrustManagerFactory!: A trust manager factory.

static fun trustServerOnFirstUse(knownServersFile: Path!, acceptCASigned: Boolean): TrustManagerFactory! (source)

Trust server certificates on first use.

On first connection to a server (identified by host+port) the fingerprint of the presented certificate will be recorded in knownServersFile. On subsequent connections, the presented certificate will be matched to the stored fingerprint to ensure it has not changed.

Parameters

knownServersFile - Path!: The path to the file containing fingerprints by host.

acceptCASigned - Boolean: If true, CA-signed certificates will always be accepted (and the fingerprint will not be recorded).

Return
TrustManagerFactory!: A trust manager factory.

static fun trustServerOnFirstUse(repository: FingerprintRepository!, acceptCASigned: Boolean): TrustManagerFactory! (source)

Trust server certificates on first use.

On first connection to a server (identified by host+port) the fingerprint of the presented certificate will be recorded in knownServersFile. On subsequent connections, the presented certificate will be matched to the stored fingerprint to ensure it has not changed.

Parameters

repository - FingerprintRepository!: The repository in which to record fingerprints by host.

acceptCASigned - Boolean: If true, CA-signed certificates will always be accepted (and the fingerprint will not be recorded).

Return
TrustManagerFactory!: A trust manager factory.

static fun trustServerOnFirstUse(knownServersFile: Path!, tmf: TrustManagerFactory!): TrustManagerFactory! (source)

Accept CA-signed certificates, and otherwise trust server certificates on first use.

Except when a server presents a CA-signed certificate, on first connection to a server (identified by host+port) the fingerprint of the presented certificate will be recorded in knownServersFile. On subsequent connections, the presented certificate will be matched to the stored fingerprint to ensure it has not changed.

Parameters

knownServersFile - Path!: The path to the file containing fingerprints by host.

tmf - TrustManagerFactory!: A TrustManagerFactory for checking server certificates against a CA.

Return
TrustManagerFactory!: A trust manager factory.

static fun trustServerOnFirstUse(repository: FingerprintRepository!, tmf: TrustManagerFactory!): TrustManagerFactory! (source)

Accept CA-signed certificates, and otherwise trust server certificates on first use.

Except when a server presents a CA-signed certificate, on first connection to a server (identified by host+port) the fingerprint of the presented certificate will be recorded in knownServersFile. On subsequent connections, the presented certificate will be matched to the stored fingerprint to ensure it has not changed.

Parameters

repository - FingerprintRepository!: The repository in which to record fingerprints by host.

tmf - TrustManagerFactory!: A TrustManagerFactory for checking server certificates against a CA.

Return
TrustManagerFactory!: A trust manager factory.