[ 
https://issues.apache.org/jira/browse/ROCKETMQ-28?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16066257#comment-16066257
 ] 

ASF GitHub Bot commented on ROCKETMQ-28:
----------------------------------------

Github user lizhanhui commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/118#discussion_r124500269
  
    --- Diff: 
remoting/src/main/java/org/apache/rocketmq/remoting/netty/FileRegionEncoder.java
 ---
    @@ -0,0 +1,76 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.rocketmq.remoting.netty;
    +
    +import io.netty.buffer.ByteBuf;
    +import io.netty.channel.ChannelHandlerContext;
    +import io.netty.channel.FileRegion;
    +import io.netty.handler.codec.MessageToByteEncoder;
    +
    +import io.netty.handler.ssl.SslHandler;
    +import java.io.IOException;
    +import java.nio.ByteBuffer;
    +import java.nio.channels.WritableByteChannel;
    +
    +/**
    + * <p>
    + *     By default, file region are directly transferred to socket channel 
which is known as zero copy. In case we need
    + *     to encrypt transmission, data being sent should go through the 
{@link SslHandler}. This encoder ensures this
    + *     process.
    + * </p>
    + */
    +public class FileRegionEncoder extends MessageToByteEncoder<FileRegion> {
    --- End diff --
    
    > You mean that SSL handler can't work properly without FileRegionEncoder?
    
    It depends. 
    If the data is in the user space memory, SSL handler works fine. If the 
code directly transfers data from file to network, similar to sendFile, SSL 
handler won't work as expected. 


> Transportation Layer Security
> -----------------------------
>
>                 Key: ROCKETMQ-28
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-28
>             Project: Apache RocketMQ
>          Issue Type: New Feature
>          Components: rocketmq-remoting
>            Reporter: Zhanhui Li
>            Assignee: Zhanhui Li
>             Fix For: 4.2.0-incubating
>
>
> RocketMQ delivers data in clear text for now, which requires internal network 
> environment. As use scenarios expand, end-to-end security is in bad need. 
> This issue is to introduce features making RocketMQ security for various use 
> cases and sacrificing as few as possible.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to