Class TlsPolicy.Builder
java.lang.Object
org.apache.pulsar.client.api.v5.config.TlsPolicy.Builder
- Enclosing class:
TlsPolicy
Builder for
TlsPolicy.-
Method Summary
Modifier and TypeMethodDescriptionallowInsecureConnection(boolean allowInsecureConnection) Whether to allow connecting to brokers with untrusted certificates.build()certificateFilePath(String certificateFilePath) Path to the client certificate file (PEM format) for mutual TLS.enableHostnameVerification(boolean enableHostnameVerification) Whether to verify the broker hostname against the certificate.keyFilePath(String keyFilePath) Path to the client private key file (PEM format) for mutual TLS.trustCertsFilePath(String trustCertsFilePath) Path to the trusted CA certificate file (PEM format).
-
Method Details
-
trustCertsFilePath
Path to the trusted CA certificate file (PEM format).- Parameters:
trustCertsFilePath- the trust store path- Returns:
- this builder
-
keyFilePath
Path to the client private key file (PEM format) for mutual TLS.- Parameters:
keyFilePath- the client key path- Returns:
- this builder
-
certificateFilePath
Path to the client certificate file (PEM format) for mutual TLS.- Parameters:
certificateFilePath- the client certificate path- Returns:
- this builder
-
allowInsecureConnection
Whether to allow connecting to brokers with untrusted certificates. Defaultfalse. Enable only for development.- Parameters:
allowInsecureConnection- whether to skip certificate validation- Returns:
- this builder
-
enableHostnameVerification
Whether to verify the broker hostname against the certificate. Defaulttrue.- Parameters:
enableHostnameVerification- whether to verify the hostname- Returns:
- this builder
-
build
- Returns:
- a new
TlsPolicyinstance
-