HTTPS throws broken pipe & connection reset by peer error

1,264 views
Skip to first unread message

Stephane Piette

unread,
Aug 25, 2011, 9:35:38 AM8/25/11
to play-framework
Hi,

I'm trying to install HTTPS on my web app using this
http://www.playframework.org/documentation/1.1.1/releasenotes-1.1#https
I'm not using keystore, and I generated my certificate with openssl.

When I browse to my apps, everything is Ok in the client side, but the
server log an erro for each request.
Here is the stacktrace :


14:56:58,837 ERROR ~
java.io.IOException: Connexion ré-initialisée par le correspondant //
connection reset by peer
at sun.nio.ch.FileDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:202)
at sun.nio.ch.IOUtil.read(IOUtil.java:169)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:
243)
at
org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:321)
at
org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:
280)
at
org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
14:56:58,838 ERROR ~
java.io.IOException: Relais brisé (pipe) //broken pipe
at sun.nio.ch.FileDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:72)
at sun.nio.ch.IOUtil.write(IOUtil.java:28)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:
334)
at org.jboss.netty.channel.socket.nio.SocketSendBufferPool
$PooledSendBuffer.transferTo(SocketSendBufferPool.java:239)
at
org.jboss.netty.channel.socket.nio.NioWorker.write0(NioWorker.java:
469)
at
org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:
387)
at
org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:
137)
at
org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:
76)
at org.jboss.netty.channel.Channels.write(Channels.java:632)
at org.jboss.netty.channel.Channels.write(Channels.java:593)
at
org.jboss.netty.handler.ssl.SslHandler.wrapNonAppData(SslHandler.java:
803)
at
org.jboss.netty.handler.ssl.SslHandler.closeOutboundAndChannel(SslHandler.java:
1045)
at
org.jboss.netty.handler.ssl.SslHandler.handleDownstream(SslHandler.java:
409)
at
org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:
60)
at
org.jboss.netty.handler.stream.ChunkedWriteHandler.handleDownstream(ChunkedWriteHandler.java:
114)
at org.jboss.netty.channel.Channels.close(Channels.java:720)
at
org.jboss.netty.channel.AbstractChannel.close(AbstractChannel.java:
208)
at
play.server.ssl.SslPlayHandler.exceptionCaught(SslPlayHandler.java:60)
at
org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:
148)
at
org.jboss.netty.handler.codec.replay.ReplayingDecoder.exceptionCaught(ReplayingDecoder.java:
461)
at
org.jboss.netty.handler.ssl.SslHandler.exceptionCaught(SslHandler.java:
510)
at
org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:
432)
at
org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:331)
at
org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:
280)
at
org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

Those errors don't alter the program, but I don't really like it ^^
And why the hell are they in French !!??

Stephane Piette

unread,
Aug 29, 2011, 5:52:12 AM8/29/11
to play-framework
Anyone ???

On 25 août, 15:35, Stephane Piette <steph...@meomeo-apps.com> wrote:
> Hi,
>
> I'm trying to install HTTPS on my web app using thishttp://www.playframework.org/documentation/1.1.1/releasenotes-1.1#https

Nicolas Leroux

unread,
Aug 29, 2011, 5:55:28 AM8/29/11
to play-fr...@googlegroups.com
Are you sure this is for every request? This is a bit weird as it should not do that. It looks to me like it is logging a bit too much thing, but I don't understand why this is happening on every request. Do you think you could send me a test app?

Nicolas

> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>

Stephane Piette

unread,
Aug 29, 2011, 7:18:54 AM8/29/11
to play-framework
Yeah, you are right, it doesn't happen every time, but often.
For the test app, a standard project is enough :
= juste type "play new test", add
' https.port=9800
#X509 certificates
certificate.key.file=conf/host.key
certificate.file=conf/host.cert ' in application.conf file, and create
certificate with openssl.

MMmhhh, this should come from my computer.

I heard about 'ulimit' params in linux, to allow more files to be
opened, but it's already set to more than 10k...

Thijs

unread,
Aug 29, 2011, 9:24:24 AM8/29/11
to play-fr...@googlegroups.com
I've been having the exceptions as well, for me it is not for every request but sometimes when I close the browser and sometimes after some time (this is probably the keep-alive on https connections).

I think (don't know for sure) the exceptions are harmless but Play should silently ignore these errors.


java.io.IOException: De externe host heeft een verbinding verbroken
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:33)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:72)
at sun.nio.ch.IOUtil.write(IOUtil.java:28)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)
at org.jboss.netty.channel.socket.nio.SocketSendBufferPool$PooledSendBuffer.transferTo(SocketSendBufferPool.java:239)
at org.jboss.netty.channel.socket.nio.NioWorker.write0(NioWorker.java:469)
at org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:387)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:137)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:76)
at org.jboss.netty.channel.Channels.write(Channels.java:632)
at org.jboss.netty.channel.Channels.write(Channels.java:593)
at org.jboss.netty.handler.ssl.SslHandler.wrapNonAppData(SslHandler.java:803)
at org.jboss.netty.handler.ssl.SslHandler.closeOutboundAndChannel(SslHandler.java:1045)
at org.jboss.netty.handler.ssl.SslHandler.handleDownstream(SslHandler.java:409)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60)
at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleDownstream(ChunkedWriteHandler.java:114)
at org.jboss.netty.channel.Channels.close(Channels.java:720)
at org.jboss.netty.channel.AbstractChannel.close(AbstractChannel.java:208)
at play.server.ssl.SslPlayHandler.exceptionCaught(SslPlayHandler.java:60)
at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:148)
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.exceptionCaught(ReplayingDecoder.java:461)
at org.jboss.netty.handler.ssl.SslHandler.exceptionCaught(SslHandler.java:510)
at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:432)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:331)
at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280)

Nicolas Leroux

unread,
Aug 29, 2011, 9:26:07 AM8/29/11
to play-fr...@googlegroups.com
Yes I agree. It is actually difficult to see log only error that are significant since they are all IOException I think... I will see what I can do about it.

Nicolas
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/bJ_enQyXXNQJ.

svenkubiak

unread,
Sep 16, 2012, 2:50:53 AM9/16/12
to play-fr...@googlegroups.com
Sorry, for brining this old post up again, but i'm having this error a lot lately with Play 1.2.5 when using SSL. Any news on how to solves or avoid this?

Nicolas Leroux

unread,
Sep 18, 2012, 2:32:12 PM9/18/12
to play-fr...@googlegroups.com
They should just be ignored, it is a logging configuration issue.
--
Nicolas Leroux



To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/7wOrIm5w8W0J.
Reply all
Reply to author
Forward
0 new messages