Package org.apache.pulsar.common.util
Class DefaultSslContextBuilder
- java.lang.Object
-
- org.apache.pulsar.common.util.SslContextAutoRefreshBuilder<javax.net.ssl.SSLContext>
-
- org.apache.pulsar.common.util.DefaultSslContextBuilder
-
public class DefaultSslContextBuilder extends SslContextAutoRefreshBuilder<javax.net.ssl.SSLContext>
-
-
Field Summary
Fields Modifier and Type Field Description protected booleantlsAllowInsecureConnectionprotected FileModifiedTimeUpdatertlsCertificateFilePathprotected FileModifiedTimeUpdatertlsKeyFilePathprotected booleantlsRequireTrustedClientCertOnConnectprotected FileModifiedTimeUpdatertlsTrustCertsFilePath-
Fields inherited from class org.apache.pulsar.common.util.SslContextAutoRefreshBuilder
lastRefreshTime, refreshTime
-
-
Constructor Summary
Constructors Constructor Description DefaultSslContextBuilder(boolean allowInsecure, java.lang.String trustCertsFilePath, java.lang.String certificateFilePath, java.lang.String keyFilePath, boolean requireTrustedClientCertOnConnect, long certRefreshInSec)DefaultSslContextBuilder(boolean allowInsecure, java.lang.String trustCertsFilePath, java.lang.String certificateFilePath, java.lang.String keyFilePath, boolean requireTrustedClientCertOnConnect, long certRefreshInSec, java.lang.String providerName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.net.ssl.SSLContextgetSslContext()Returns cached SSLContext.booleanneedUpdate()Returns whether the key files modified after a refresh time, and context need update.javax.net.ssl.SSLContextupdate()updates and returns cached SSLContext.-
Methods inherited from class org.apache.pulsar.common.util.SslContextAutoRefreshBuilder
get
-
-
-
-
Field Detail
-
tlsAllowInsecureConnection
protected final boolean tlsAllowInsecureConnection
-
tlsTrustCertsFilePath
protected final FileModifiedTimeUpdater tlsTrustCertsFilePath
-
tlsCertificateFilePath
protected final FileModifiedTimeUpdater tlsCertificateFilePath
-
tlsKeyFilePath
protected final FileModifiedTimeUpdater tlsKeyFilePath
-
tlsRequireTrustedClientCertOnConnect
protected final boolean tlsRequireTrustedClientCertOnConnect
-
-
Constructor Detail
-
DefaultSslContextBuilder
public DefaultSslContextBuilder(boolean allowInsecure, java.lang.String trustCertsFilePath, java.lang.String certificateFilePath, java.lang.String keyFilePath, boolean requireTrustedClientCertOnConnect, long certRefreshInSec)
-
DefaultSslContextBuilder
public DefaultSslContextBuilder(boolean allowInsecure, java.lang.String trustCertsFilePath, java.lang.String certificateFilePath, java.lang.String keyFilePath, boolean requireTrustedClientCertOnConnect, long certRefreshInSec, java.lang.String providerName)
-
-
Method Detail
-
update
public javax.net.ssl.SSLContext update() throws java.security.GeneralSecurityExceptionDescription copied from class:SslContextAutoRefreshBuilderupdates and returns cached SSLContext.- Specified by:
updatein classSslContextAutoRefreshBuilder<javax.net.ssl.SSLContext>- Returns:
- Throws:
java.security.GeneralSecurityException
-
getSslContext
public javax.net.ssl.SSLContext getSslContext()
Description copied from class:SslContextAutoRefreshBuilderReturns cached SSLContext.- Specified by:
getSslContextin classSslContextAutoRefreshBuilder<javax.net.ssl.SSLContext>- Returns:
-
needUpdate
public boolean needUpdate()
Description copied from class:SslContextAutoRefreshBuilderReturns whether the key files modified after a refresh time, and context need update.- Specified by:
needUpdatein classSslContextAutoRefreshBuilder<javax.net.ssl.SSLContext>- Returns:
- true if files modified
-
-