Interface GrpcConnectionContext
public interface GrpcConnectionContext
Exposes connection-level information to gRPC request handlers. An instance of this interface is
available from
ServerContextKeys.CONNECTION_CONTEXT in the current gRPC context.-
Method Summary
Modifier and TypeMethodDescriptionConnection socket id.booleanisSecure()Whether the request is secure.Local peer information.Proxy protocol header data.Remote peer information.Server socket id.Configured virtual-host host that matched the TLS Server Name Indication (SNI) requested host.Normalized DNS host name requested by the client using TLS Server Name Indication (SNI).
-
Method Details
-
serverSocketId
-
connectionSocketId
-
remotePeer
-
localPeer
-
isSecure
boolean isSecure()Whether the request is secure.- Returns:
- whether secure
-
proxyProtocolData
Optional<ProxyProtocolData> proxyProtocolData()Proxy protocol header data.- Returns:
- protocol header data if proxy protocol is enabled on socket
- See Also:
-
sniRequestedHost
Normalized DNS host name requested by the client using TLS Server Name Indication (SNI).This value comes from the client TLS handshake, so it is suitable for diagnostics and application choices that are expected to use client-requested host names, but it should not be treated as a trusted identity by itself.
- Returns:
- normalized SNI requested host, if available
-
sniMatchedHost
Configured virtual-host host that matched the TLS Server Name Indication (SNI) requested host.For wildcard virtual hosts, this method returns the configured wildcard host such as
*.example.com.- Returns:
- configured SNI matched host, if a virtual host matched
-