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
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