Class EppServiceHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
,io.netty.channel.ChannelOutboundHandler
-
Nested Class Summary
Nested classes/interfaces inherited from class google.registry.proxy.handler.HttpsRelayServiceHandler
HttpsRelayServiceHandler.NonOkHttpResponseException
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Modifier and TypeFieldDescriptionstatic final io.netty.util.AttributeKey
<String> Attribute key to the client certificate hash whose value is set when the certificate promise is fulfilled.static final String
Fields inherited from class google.registry.proxy.handler.HttpsRelayServiceHandler
metrics, NON_FATAL_INBOUND_EXCEPTIONS, NON_FATAL_OUTBOUND_EXCEPTIONS
-
Constructor Summary
ConstructorDescriptionEppServiceHandler
(String relayHost, String relayPath, boolean canary, Supplier<String> idTokenSupplier, byte[] helloBytes, FrontendMetrics metrics) -
Method Summary
Modifier and TypeMethodDescriptionvoid
channelActive
(io.netty.channel.ChannelHandlerContext ctx) Write<hello>
to the server after SSL handshake completion to request<greeting>
protected io.netty.handler.codec.http.FullHttpRequest
decodeFullHttpRequest
(io.netty.buffer.ByteBuf byteBuf) Construct theFullHttpRequest
.void
write
(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Terminates connection upon outbound exception.Methods inherited from class google.registry.proxy.handler.HttpsRelayServiceHandler
decode, encode, exceptionCaught
Methods inherited from class io.netty.handler.codec.ByteToMessageCodec
acceptOutboundMessage, channelInactive, channelRead, channelReadComplete, decodeLast, handlerAdded, handlerRemoved
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Field Details
-
CLIENT_CERTIFICATE_HASH_KEY
Attribute key to the client certificate hash whose value is set when the certificate promise is fulfilled. -
EPP_CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
EppServiceHandler
public EppServiceHandler(String relayHost, String relayPath, boolean canary, Supplier<String> idTokenSupplier, byte[] helloBytes, FrontendMetrics metrics)
-
-
Method Details
-
channelActive
Write<hello>
to the server after SSL handshake completion to request<greeting>
When handling EPP over TCP, the server should issue a
<greeting>
to the client when a connection is established. Nomulus app however does not automatically sends the<greeting>
upon connection. The proxy therefore first sends a<hello>
to registry to request a<greeting>
response.The
<hello>
request is only sent after SSL handshake is completed between the client and the proxy so that the client certificate hash is available, which is needed to communicate with the server. BecauseSslHandshakeCompletionEvent
is triggered before any calls toByteToMessageCodec.channelRead(io.netty.channel.ChannelHandlerContext, java.lang.Object)
are scheduled by the event loop executor, the<hello>
request is guaranteed to be the first message sent to the server.- Specified by:
channelActive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelActive
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
- See Also:
-
decodeFullHttpRequest
protected io.netty.handler.codec.http.FullHttpRequest decodeFullHttpRequest(io.netty.buffer.ByteBuf byteBuf) Description copied from class:HttpsRelayServiceHandler
Construct theFullHttpRequest
.This default method creates a bare-bone
FullHttpRequest
that may need to be modified, e.g. adding headers specific for each protocol.- Overrides:
decodeFullHttpRequest
in classHttpsRelayServiceHandler
- Parameters:
byteBuf
- inbound message.
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) throws Exception Description copied from class:HttpsRelayServiceHandler
Terminates connection upon outbound exception.- Specified by:
write
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classHttpsRelayServiceHandler
- Throws:
Exception
-