Class EppServiceHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.netty.handler.codec.ByteToMessageCodec<io.netty.handler.codec.http.FullHttpResponse>
google.registry.proxy.handler.HttpsRelayServiceHandler
google.registry.proxy.handler.EppServiceHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler

public class EppServiceHandler extends HttpsRelayServiceHandler
Handler that processes EPP protocol logic.
  • 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

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
    EppServiceHandler(String relayHost, String relayPath, boolean canary, Supplier<String> idTokenSupplier, byte[] helloBytes, FrontendMetrics metrics)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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 the FullHttpRequest.
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CLIENT_CERTIFICATE_HASH_KEY

      public static final io.netty.util.AttributeKey<String> CLIENT_CERTIFICATE_HASH_KEY
      Attribute key to the client certificate hash whose value is set when the certificate promise is fulfilled.
    • EPP_CONTENT_TYPE

      public static final String EPP_CONTENT_TYPE
      See Also:
  • Constructor Details

  • Method Details

    • channelActive

      public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      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. Because SslHandshakeCompletionEvent is triggered before any calls to ByteToMessageCodec.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 interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelActive in class io.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 the FullHttpRequest.

      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 class HttpsRelayServiceHandler
      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 interface io.netty.channel.ChannelOutboundHandler
      Overrides:
      write in class HttpsRelayServiceHandler
      Throws:
      Exception