java - Cannot secure connection using TLS -
i'm trying establish secure socket connection between java client applet (built jdk 1.7.0_75-b13) , vc++ server application.
as test vehicle, used vc++ client/server sample found in msdn forums, modified use schannel , able establish socket using cipher suite tls_rsa_with_aes_128_cbc_sha. works of tls 1.0/1.1/1.2.
when try opening socket java applet same server application, connection rejected server reporting following:
tls 1.0 acceptsecuritycontext failed: 0x80090327
tls 1.1 acceptsecuritycontext failed: 0x80090331
tls 1.2 acceptsecuritycontext failed: 0x80090331
this java code used create socket:
debugprint("setting secure connection"); sslsocketfactory sslsocketfactory = (sslsocketfactory) sslsocketfactory.getdefault(); sslsocket sslsocket = (sslsocket) sslsocketfactory.createsocket("127.0.0.1", socketnumber); debugprint("starting handshake"); sslsocket.settcpnodelay(true); sslsocket.setsolinger(false, 0); sslsocket.setkeepalive(true); sslsocket.setreuseaddress(true); sslsocket.setsotimeout(10000); sslsocket.setuseclientmode(true); sslsocket.setwantclientauth(false); sslsocket.addhandshakecompletedlistener(new handshakecompletedlistener() { @override public void handshakecompleted(handshakecompletedevent arg0) { debugprint("handshake complete!"); stealthstatus.setserviceconnected(true); } }); string ciphersuites[] = sslsocket.getenabledciphersuites(); (int inx=0; inx < ciphersuites.length; inx++) { debugprint("ssl cipher suite supported->" + ciphersuites[inx]); } sslsocket.setenabledciphersuites(ciphersuites); sslsocket.starthandshake(); socket = sslsocket; socketout = sslsocket.getoutputstream(); socketin = sslsocket.getinputstream();
running this, call getenabledciphersuites returns list
tls_ecdhe_ecdsa_with_aes_128_cbc_sha
tls_ecdhe_rsa_with_aes_128_cbc_sha
tls_rsa_with_aes_128_cbc_sha
tls_ecdh_ecdsa_with_aes_128_cbc_sha
tls_ecdh_rsa_with_aes_128_cbc_sha
tls_dhe_rsa_with_aes_128_cbc_sha
tls_dhe_dss_with_aes_128_cbc_sha
tls_ecdhe_ecdsa_with_3des_ede_cbc_sha
tls_ecdhe_rsa_with_3des_ede_cbc_sha
ssl_rsa_with_3des_ede_cbc_sha
tls_ecdh_ecdsa_with_3des_ede_cbc_sha
tls_ecdh_rsa_with_3des_ede_cbc_sha
ssl_dhe_rsa_with_3des_ede_cbc_sha
ssl_dhe_dss_with_3des_ede_cbc_sha
tls_ecdhe_ecdsa_with_rc4_128_sha
tls_ecdhe_rsa_with_rc4_128_sha
ssl_rsa_with_rc4_128_sha
tls_ecdh_ecdsa_with_rc4_128_sha
tls_ecdh_rsa_with_rc4_128_sha
ssl_rsa_with_rc4_128_md5
tls_empty_renegotiation_info_scsv
which includes desired tls_rsa_with_aes_128_cbc_sha , passed setenabledciphersuites.
what needed vc++ server accept connection java client?
see: http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/readdebug.html
in many cases, log messages generated when using -djavax.net.debug=all flag can lead in right direction.
Comments
Post a Comment