Package io.grpc.xds.internal.security
Class SslContextProviderSupplier
- java.lang.Object
-
- io.grpc.xds.internal.security.SslContextProviderSupplier
-
- All Implemented Interfaces:
Closeable,java.io.Closeable,java.lang.AutoCloseable
public final class SslContextProviderSupplier extends java.lang.Object implements Closeable
Enables Client or server side to initialize this object with the receivedEnvoyServerProtoData.BaseTlsContextand communicate it to the consumer i.e.SecurityProtocolNegotiatorsto lazily evaluate theSslContextProvider. The supplier prevents credentials leakage in cases where the user is not using xDS credentials but the client/server contains a non-defaultEnvoyServerProtoData.BaseTlsContext.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanshutdownprivate SslContextProvidersslContextProviderprivate EnvoyServerProtoData.BaseTlsContexttlsContextprivate TlsContextManagertlsContextManager
-
Constructor Summary
Constructors Constructor Description SslContextProviderSupplier(EnvoyServerProtoData.BaseTlsContext tlsContext, TlsContextManager tlsContextManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Called by consumer when tlsContext changes.booleanequals(java.lang.Object o)private SslContextProvidergetSslContextProvider()EnvoyServerProtoData.BaseTlsContextgetTlsContext()inthashCode()booleanisShutdown()private voidreleaseSslContextProvider(SslContextProvider toRelease)java.lang.StringtoString()voidupdateSslContext(SslContextProvider.Callback callback)Updates SslContext via the passed callback.
-
-
-
Field Detail
-
tlsContext
private final EnvoyServerProtoData.BaseTlsContext tlsContext
-
tlsContextManager
private final TlsContextManager tlsContextManager
-
sslContextProvider
private SslContextProvider sslContextProvider
-
shutdown
private boolean shutdown
-
-
Constructor Detail
-
SslContextProviderSupplier
public SslContextProviderSupplier(EnvoyServerProtoData.BaseTlsContext tlsContext, TlsContextManager tlsContextManager)
-
-
Method Detail
-
getTlsContext
public EnvoyServerProtoData.BaseTlsContext getTlsContext()
-
updateSslContext
public void updateSslContext(SslContextProvider.Callback callback)
Updates SslContext via the passed callback.
-
releaseSslContextProvider
private void releaseSslContextProvider(SslContextProvider toRelease)
-
getSslContextProvider
private SslContextProvider getSslContextProvider()
-
isShutdown
public boolean isShutdown()
-
close
public void close()
Called by consumer when tlsContext changes.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-