public static class Config.TrustStrategy extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
Config.TrustStrategy.Strategy
The trust strategy that the driver supports
|
| Modifier and Type | Method and Description |
|---|---|
File |
certFile()
Return the configured certificate file.
|
boolean |
isHostnameVerificationEnabled()
Check if hostname verification is enabled for this trust strategy.
|
org.neo4j.driver.internal.RevocationStrategy |
revocationStrategy()
The revocation strategy used for verifying certificates.
|
Config.TrustStrategy.Strategy |
strategy()
Return the strategy type desired.
|
static Config.TrustStrategy |
trustAllCertificates()
Trust strategy for certificates that trust all certificates blindly.
|
static Config.TrustStrategy |
trustCustomCertificateSignedBy(File certFile)
Only encrypted connections to Neo4j instances with certificates signed by a trusted certificate will be accepted.
|
static Config.TrustStrategy |
trustSystemCertificates()
Trust strategy for certificates that can be verified through the local system store.
|
Config.TrustStrategy |
withHostnameVerification()
Enable hostname verification for this trust strategy.
|
Config.TrustStrategy |
withoutCertificateRevocationChecks()
Configures the
Config.TrustStrategy to not carry out OCSP revocation checks on certificates. |
Config.TrustStrategy |
withoutHostnameVerification()
Disable hostname verification for this trust strategy.
|
Config.TrustStrategy |
withStrictRevocationChecks()
Configures the
Config.TrustStrategy to carry out strict OCSP revocation checks for revocation status that
are stapled to the certificate. |
Config.TrustStrategy |
withVerifyIfPresentRevocationChecks()
Configures the
Config.TrustStrategy to carry out OCSP revocation checks when the revocation status is
stapled to the certificate. |
public Config.TrustStrategy.Strategy strategy()
public File certFile()
null if trust strategy does not require a certificate.public boolean isHostnameVerificationEnabled()
true if hostname verification has been enabled via withHostnameVerification(), false otherwise.public Config.TrustStrategy withHostnameVerification()
public Config.TrustStrategy withoutHostnameVerification()
public static Config.TrustStrategy trustCustomCertificateSignedBy(File certFile)
The certificate(s) in the file must be encoded using PEM encoding, meaning the certificates in the file should be encoded using Base64, and each certificate is bounded at the beginning by "-----BEGIN CERTIFICATE-----", and bounded at the end by "-----END CERTIFICATE-----".
certFile - the trusted certificate filepublic static Config.TrustStrategy trustSystemCertificates()
public static Config.TrustStrategy trustAllCertificates()
public org.neo4j.driver.internal.RevocationStrategy revocationStrategy()
Config.TrustStrategy's revocation strategypublic Config.TrustStrategy withoutCertificateRevocationChecks()
Config.TrustStrategy to not carry out OCSP revocation checks on certificates. This is the
option that is configured by default.public Config.TrustStrategy withVerifyIfPresentRevocationChecks()
Config.TrustStrategy to carry out OCSP revocation checks when the revocation status is
stapled to the certificate. If no stapled response is found, then certificate verification continues
(and does not fail verification). This setting also requires the server to be configured to enable
OCSP stapling.public Config.TrustStrategy withStrictRevocationChecks()
Config.TrustStrategy to carry out strict OCSP revocation checks for revocation status that
are stapled to the certificate. If no stapled response is found, then the driver will fail certificate verification
and not connect to the server. This setting also requires the server to be configured to enable OCSP stapling.
Note: enabling this setting will prevent the driver connecting to the server when the server is unable to reach
the certificate's configured OCSP responder URL.