TLS/SSL handshaking errors

D

Dan Orzechowski

Hello,

I'm pretty new to SSL, and I'm trying to write a client and server that
will communicate over TLS (the client is a Java applet, and the server
is written in C). I'm trying to send just an array of bytes over the
connection, but I'm getting fatal handshaking errors upon connection.

All of my code seems to be pretty straightforward:

---

byte[] arr = new byte[32];
for (int i = 0; i < 32; i++) arr = (byte)(31 - i);
try
{
SSLSocketFactory sslsocketfactory =
(SSLSocketFactory)SSLSocketFactory.getDefault();
SSLSocket sslsocket =
(SSLSocket)sslsocketfactory.createSocket("localhost", 34567);
sslsocket.setEnabledProtocols(new String[] {"TLSv1"});
sslsocket.getOutputStream().write(arr);
sslsocket.close();
}
catch (Exception e)
{
System.out.println(e.toString());
}

---

When invoked as

$ javac test.java && java test

the program prints the following to stdout:

org.metastatic.jessie.provider.AlertException: handshake_failure:
remotely generated; fatal

The server reports the SSL error to be of type 193, which from what I
can tell corresponds to a "no shared cipher" error. I printed out the
contents of sslsocket.getEnabledCipherSuites() and verified that the
cipher I'm using on the server side is supported by the client.

What could I be missing? thanks in advance for any help.

- Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top