I'm not experienced at all using SSL. I created a very simple client server and can successfully both send and retrieve files from the server with my client. I generated a keystore with a self-signed X509 certificate via keytool command line and stored it in my server directory.
I'm a little confused though, since I initially created my server using http://stilius.net/java/java_ssl.php as a guide but couldn't get it to work, I was using
System.setProperty("javax.net.ssl.keyStore", jksFilepath);
System.setProperty("javax.net.ssl.keyStorePassword", jkspass);
to link my keystore with the server. Whenever I tried to retrieve a file I would get Java SSLHandshakeException “no cipher suites in common”.
However when I now use code identical to: http://www.java2s.com/Tutorial/Java/0490__Security/SSLContextandKeymanager.htm to setup my server, it works perfectly fine.
Also, the second guide just uses a ServerSocket and not an SSLSocket - which should I be using? Switching between both doesn't seem to change anything when I run the server and retrieve a file.