java - Connection reset by peer with async http client and netty -



java - Connection reset by peer with async http client and netty -

i've got unusual problem async http client netty http provider, it's play application calling remote web service don't have access to. it's of import note service on ssl-encrypted domain , reponds domain , not ip. stacktrace:

java.io.ioexception: connection reset peer @ sun.nio.ch.filedispatcherimpl.read0(native method) ~[na:1.7.0_60] @ sun.nio.ch.socketdispatcher.read(socketdispatcher.java:39) ~[na:1.7.0_60] @ sun.nio.ch.ioutil.readintonativebuffer(ioutil.java:223) ~[na:1.7.0_60] @ sun.nio.ch.ioutil.read(ioutil.java:192) ~[na:1.7.0_60] @ sun.nio.ch.socketchannelimpl.read(socketchannelimpl.java:379) ~[na:1.7.0_60] @ org.jboss.netty.channel.socket.nio.nioworker.read(nioworker.java:64) ~[netty-3.9.2.final.jar:na] @ org.jboss.netty.channel.socket.nio.abstractnioworker.process(abstractnioworker.java:108) ~[netty-3.9.2.final.jar:na] @ org.jboss.netty.channel.socket.nio.abstractnioselector.run(abstractnioselector.java:318) ~[netty-3.9.2.final.jar:na] @ org.jboss.netty.channel.socket.nio.abstractnioworker.run(abstractnioworker.java:89) ~[netty-3.9.2.final.jar:na] @ org.jboss.netty.channel.socket.nio.nioworker.run(nioworker.java:178) ~[netty-3.9.2.final.jar:na] @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) [na:1.7.0_60] @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) [na:1.7.0_60] @ java.lang.thread.run(thread.java:745) [na:1.7.0_60]

the unusual happened (it's test environment used customer) makes me believe either receiving service or network, can't find out whats wrong because calling same url curl works fine.

i've tried isolate problem using async http client (which play uses it's ws interface) locally , same error, curl works, using javas url-api works. when i'm using jdkasynchttpprovider http provider works fine.

seek { asynchttpclientconfig cf = new asynchttpclientconfig.builder().build(); // works if utilize jdkasynchttpprovider.. //asynchttpclient asynchttpclient = new asynchttpclient(new jdkasynchttpprovider(cf)); asynchttpclient asynchttpclient = new asynchttpclient(cf); future<response> f = asynchttpclient.prepareget(nw).execute(); response r = f.get(); system.out.println(r.getresponsebody()); } catch(exception e) { e.printstacktrace(); }

since i'm using play framework can't alter provider.

i'm stuck , i'm asking pointers problem might or next step in debugging.

update: debugging options on next error:

extension ec_point_formats, formats: [uncompressed] *** [write] md5 , sha1 hashes: len = 149 0000: 01 00 00 91 03 01 53 advertisement 17 dd 91 78 24 7e 9a 58 ......s....x$..x 0010: 0e ca d9 ed 22 5a a9 df 3f 4c dd 25 58 e1 e6 c1 ...."z..?l.%x... 0020: 4c 63 3e 11 78 1e 00 00 2a c0 09 c0 13 00 2f c0 lc>.x...*...../. 0030: 04 c0 0e 00 33 00 32 c0 07 c0 11 00 05 c0 02 c0 ....3.2......... 0040: 0c c0 08 c0 12 00 0a c0 03 c0 0d 00 16 00 13 00 ................ 0050: 04 00 ff 01 00 00 3e 00 0a 00 34 00 32 00 17 00 ......>...4.2... 0060: 01 00 03 00 13 00 15 00 06 00 07 00 09 00 0a 00 ................ 0070: 18 00 0b 00 0c 00 19 00 0d 00 0e 00 0f 00 10 00 ................ 0080: 11 00 02 00 12 00 04 00 05 00 14 00 08 00 16 00 ................ 0090: 0b 00 02 01 00 ..... new i/o worker #2, write: tlsv1 handshake, length = 149 [raw write]: length = 154 0000: 16 03 01 00 95 01 00 00 91 03 01 53 advertisement 17 dd 91 ...........s.... 0010: 78 24 7e 9a 58 0e ca d9 ed 22 5a a9 df 3f 4c dd x$..x...."z..?l. 0020: 25 58 e1 e6 c1 4c 63 3e 11 78 1e 00 00 2a c0 09 %x...lc>.x...*.. 0030: c0 13 00 2f c0 04 c0 0e 00 33 00 32 c0 07 c0 11 .../.....3.2.... 0040: 00 05 c0 02 c0 0c c0 08 c0 12 00 0a c0 03 c0 0d ................ 0050: 00 16 00 13 00 04 00 ff 01 00 00 3e 00 0a 00 34 ...........>...4 0060: 00 32 00 17 00 01 00 03 00 13 00 15 00 06 00 07 .2.............. 0070: 00 09 00 0a 00 18 00 0b 00 0c 00 19 00 0d 00 0e ................ 0080: 00 0f 00 10 00 11 00 02 00 12 00 04 00 05 00 14 ................ 0090: 00 08 00 16 00 0b 00 02 01 00 .......... 09:06:05.883 [new i/o worker #2] debug c.n.h.c.p.n.nettyasynchttpprovider - unexpected i/o exception on channel [id: 0x9820cfc1, /192.168.101.123:41411 => domain/148.136.157.62:443] java.io.ioexception: connection reset peer

so tls handshake, there more can when debugging issue without access remote service?

update again, got new error message time:

[write] md5 , sha1 hashes: len = 149 0000: 01 00 00 91 03 01 53 advertisement 1c 54 d6 57 05 7a 89 e5 ......s..t.w.z.. 0010: 55 60 01 2f 48 a5 ba eb 4c e6 96 68 e7 b8 2b 67 u`./h...l..h..+g 0020: a2 4c af c8 9d 10 00 00 2a c0 09 c0 13 00 2f c0 .l......*...../. 0030: 04 c0 0e 00 33 00 32 c0 07 c0 11 00 05 c0 02 c0 ....3.2......... 0040: 0c c0 08 c0 12 00 0a c0 03 c0 0d 00 16 00 13 00 ................ 0050: 04 00 ff 01 00 00 3e 00 0a 00 34 00 32 00 17 00 ......>...4.2... 0060: 01 00 03 00 13 00 15 00 06 00 07 00 09 00 0a 00 ................ 0070: 18 00 0b 00 0c 00 19 00 0d 00 0e 00 0f 00 10 00 ................ 0080: 11 00 02 00 12 00 04 00 05 00 14 00 08 00 16 00 ................ 0090: 0b 00 02 01 00 ..... new i/o worker #2, write: tlsv1 handshake, length = 149 [raw write]: length = 154 0000: 16 03 01 00 95 01 00 00 91 03 01 53 advertisement 1c 54 d6 ...........s..t. 0010: 57 05 7a 89 e5 55 60 01 2f 48 a5 ba eb 4c e6 96 w.z..u`./h...l.. 0020: 68 e7 b8 2b 67 a2 4c af c8 9d 10 00 00 2a c0 09 h..+g.l......*.. 0030: c0 13 00 2f c0 04 c0 0e 00 33 00 32 c0 07 c0 11 .../.....3.2.... 0040: 00 05 c0 02 c0 0c c0 08 c0 12 00 0a c0 03 c0 0d ................ 0050: 00 16 00 13 00 04 00 ff 01 00 00 3e 00 0a 00 34 ...........>...4 0060: 00 32 00 17 00 01 00 03 00 13 00 15 00 06 00 07 .2.............. 0070: 00 09 00 0a 00 18 00 0b 00 0c 00 19 00 0d 00 0e ................ 0080: 00 0f 00 10 00 11 00 02 00 12 00 04 00 05 00 14 ................ 0090: 00 08 00 16 00 0b 00 02 01 00 .......... hashed wheel timer #2, called closeoutbound() hashed wheel timer #2, closeoutboundinternal() hashed wheel timer #2, send tlsv1 alert: warning, description = close_notify hashed wheel timer #2, write: tlsv1 alert, length = 2 hashed wheel timer #2, called closeinbound() hashed wheel timer #2, fatal error: 80: inbound closed before receiving peer's close_notify: possible truncation attack? javax.net.ssl.sslexception: inbound closed before receiving peer's close_notify: possible truncation attack? hashed wheel timer #2, send tlsv1 alert: fatal, description = internal_error hashed wheel timer #2, exception sending alert: java.io.ioexception: author side closed.

updated, resolved:

the remote host configured https-certificate utilize server name indication, sni caused netty provider fail. guess netty provider doesn't back upwards sni yet.

when "ssl encrypted domain", mean https?

if so, can utilize debugging feature in ws ssl: http://www.playframework.com/documentation/2.3.x/debuggingssl

or set jsse's debug flags straight -djavax.net.debug=all.

also, turn on logger.play.api.libs.ws=debug , logger.org.asynchttpclient=debug in application.conf maximum verbosity.

you can alter provider directly, if you're willing utilize asynchttpclient directly, without going through ws. mean may have mess around promise in onsuccess() callback, create limited ws-like interface homecoming future if problem.

java playframework-2.0 netty asynchttpclient

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -