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.BaseTlsContext
and communicate it to the consumer i.e.SecurityProtocolNegotiators
to 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 boolean
shutdown
private SslContextProvider
sslContextProvider
private EnvoyServerProtoData.BaseTlsContext
tlsContext
private TlsContextManager
tlsContextManager
-
Constructor Summary
Constructors Constructor Description SslContextProviderSupplier(EnvoyServerProtoData.BaseTlsContext tlsContext, TlsContextManager tlsContextManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Called by consumer when tlsContext changes.boolean
equals(java.lang.Object o)
private SslContextProvider
getSslContextProvider()
EnvoyServerProtoData.BaseTlsContext
getTlsContext()
int
hashCode()
boolean
isShutdown()
private void
releaseSslContextProvider(SslContextProvider toRelease)
java.lang.String
toString()
void
updateSslContext(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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-