SSL & HttpTunnelingClientSocketChannelFactory

"이희승 (Trustin Lee)" trustin at gmail.com
Mon Jun 1 00:22:37 EDT 2009


Hi Jason,

On 27-May-2009 22:33, Jason Ward wrote:
> 
> Hi Trustin -
> 
> I was actually in the process of upgrading from BETA2 yesterday so your
> suggestion worked. It seems that specific issue is fixed.
> 
> However, I'm now getting...
> 
> java.nio.channels.ClosedChannelException
>     at
> org.jboss.netty.channel.socket.oio.OioWorker.write(OioWorker.java:135)
>     at
> org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.eventSunk(OioClientSocketPipelineSink.java:91)
>     at org.jboss.netty.channel.Channels.write(Channels.java:878)
>     at org.jboss.netty.channel.Channels.write(Channels.java:826)
>     at
> org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:236)
>     at
> org.jboss.netty.channel.socket.http.HttpTunnelingClientSocketChannel.sendChunk(HttpTunnelingClientSocketChannel.java:176)
>     at
> org.jboss.netty.channel.socket.http.HttpTunnelWorker.write(HttpTunnelWorker.java:93)
>     at
> org.jboss.netty.channel.socket.http.HttpTunnelingClientSocketPipelineSink.eventSunk(HttpTunnelingClientSocketPipelineSink.java:88)
>     at org.jboss.netty.channel.Channels.write(Channels.java:898)
>     at org.jboss.netty.channel.Channels.write(Channels.java:840)
>     at
> org.jboss.netty.handler.ssl.SslHandler.wrapNonAppData(SslHandler.java:635)
>     at org.jboss.netty.handler.ssl.SslHandler.handshake(SslHandler.java:294)
> 
> ...even tho the channel seems connected and read/writeable : checking
> e.getChannel().isConnected(), etc. before the handshake call all look good.
> 
> Any thoughts/suggestions?
> 
> FYI - here's my handler code...
>     @Override
>     public void channelConnected(
>             ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception
> {
>         SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
> 
>         if(sslHandler != null){
> 	        System.out.println("begin handshake...");
> 	        System.out.println("e.getChannel().isConnected() =
> "+e.getChannel().isConnected());
> 	        System.out.println("e.getChannel().isBound() =
> "+e.getChannel().isBound());
> 	        System.out.println("e.getChannel().isOpen() =
> "+e.getChannel().isOpen());
> 	        System.out.println("e.getChannel().isReadable() =
> "+e.getChannel().isReadable());
> 	        System.out.println("e.getChannel().isWritable() =
> "+e.getChannel().isWritable());
> 
> 	        ChannelFuture future = sslHandler.handshake(e.getChannel());
> 	        future.awaitUninterruptibly();
> 	        if(!future.isSuccess()){
> 	        	System.out.println("future = failed");
> 	        }
> 	        else{
> 	        	System.out.println("future = success");
> 	        }
>         }
>     }

If you used 3.1.0.BETA3, your code might have raised
IllegalStateException because you called future.awaitUninterruptibly()
in the handler.  Did you get such an exception in exceptionCaught?  It
would be great if the full source code is provided so that I can
reproduce the problem easily.

Thanks,
Trustin


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20090601/c485928d/attachment.bin 


More information about the netty-users mailing list