private static InetSocketAddress getRemoteAddress(Channel channel) {
        final InetSocketAddress remoteAddress = (InetSocketAddress) channel.remoteAddress();
        if (remoteAddress == null) {
            final Throwable sslException = channel.attr(GremlinResponseHandler.INBOUND_SSL_EXCEPTION).get();
            if (sslException != null) {
                throw new RuntimeException("Request cannot be serialized because the channel is not connected due to an ssl error.", sslException);
            }
            throw new RuntimeException("Request cannot be serialized because the channel is not connected");
        }
        return remoteAddress;
    }
Converts {@link RequestMessage} to a {@code HttpRequest}.
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/handler/HttpGremlinRequestEncoder.java