title: SSL Socket connection
body: <p>How can I create a SSL Socket connection?</p>
  
  <p>I realy need to create a keystore? This keystore should be shared with all my client applications?</p>
  
  <p>I have create a server with the following code: </p>
  
  <pre><code>SSLServerSocketFactory sslserversocketfactory = (SSLServerSocketFactory) SSLServerSocketFactory
                      .getDefault();
  SSLServerSocket sslserversocket = (SSLServerSocket) sslserversocketfactory
                      .createServerSocket(ServerProperties.getInstance()
                              .getVSSPAuthenticationPort());
  </code></pre>
  
  <p>I have create a client on android with the following code: </p>
  
  <pre><code>SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory
                  .getDefault();
  SSLSocket sslsocket = (SSLSocket) sslsocketfactory.createSocket(
                  host, authPort);
  
  sslsocket.startHandshake();
  
  BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
                  sslsocket.getOutputStream()));
  BufferedReader reader = new BufferedReader(new InputStreamReader(
                  sslsocket.getInputStream()));
  </code></pre>
  
  <p>But when I try to connect, the following error is throwed:</p>
  
  <pre><code>javax.net.ssl.SSLHandshakeException: no cipher suites in common
      at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
      at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1886)
      at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276)
      at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:266)
      at sun.security.ssl.ServerHandshaker.chooseCipherSuite(ServerHandshaker.java:894)
      at sun.security.ssl.ServerHandshaker.clientHello(ServerHandshaker.java:622)
      at sun.security.ssl.ServerHandshaker.processMessage(ServerHandshaker.java:167)
      at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)
      at sun.security.ssl.Handshaker.process_record(Handshaker.java:804)
      at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016)
      at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
      at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
      at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
  </code></pre>