Class TlsPolicy
java.lang.Object
org.apache.pulsar.client.api.v5.config.TlsPolicy
TLS configuration for the Pulsar client connection.
Construct via builder(), or use ofInsecure() for development.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic TlsPolicy.Builderbuilder()booleanstatic TlsPolicyCreate an insecure TLS policy that accepts any certificate (for development only).
-
Method Details
-
trustCertsFilePath
- Returns:
- path to the trusted CA certificate file (PEM), or
nullwhen not set
-
keyFilePath
- Returns:
- path to the client private key file (PEM), or
nullwhen not using mTLS
-
certificateFilePath
- Returns:
- path to the client certificate file (PEM), or
nullwhen not using mTLS
-
allowInsecureConnection
public boolean allowInsecureConnection()- Returns:
- whether connections to brokers with untrusted certificates are allowed
-
enableHostnameVerification
public boolean enableHostnameVerification()- Returns:
- whether the broker hostname is verified against the certificate
-
ofInsecure
Create an insecure TLS policy that accepts any certificate (for development only).- Returns:
- a
TlsPolicywith insecure connections allowed and hostname verification disabled
-
builder
- Returns:
- a new builder for constructing a
TlsPolicy
-