title: Create app with SSLSocket Java
body: <p>I want to create an app use <code>SSLSocket</code>: client send a <code>String</code> to server and server will uppercase that <code>String</code> and send back to client for display.</p>
  
  <h2>SSLServer</h2>
  
  <pre><code>public class SSLServer {
      public static void main(String args[]) throws Exception
      {
          try{
          //Creaet a SSLServersocket
          SSLServerSocketFactory factory=(SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
          SSLServerSocket sslserversocket=(SSLServerSocket) factory.createServerSocket(1234);
          //Tạo 1 đối tượng Socket từ serversocket để lắng nghe và chấp nhận kết nối từ client
          SSLSocket sslsocket=(SSLSocket) sslserversocket.accept();
          //Tao cac luong de nhan va gui du lieu cua client
          DataInputStream is=new DataInputStream(sslsocket.getInputStream());
          PrintStream os=new PrintStream(sslsocket.getOutputStream());
          while(true)  //khi dang ket noi voi client
          {
              //Doc du lieu den
              String input=is.readUTF();
              String ketqua=input.toUpperCase();
              //Du lieu tra ve
              os.println(ketqua);
          }
          }
          catch(IOException e)
          {
             System.out.print(e);
          }
      }
  }
  </code></pre>
  
  <h2>SSLClient</h2>
  
  <pre><code>public class SSLClient {
      public static void main(String args[])
      {
          try
          {
          //Mo 1 client socket den server voi so cong va dia chi xac dinh
          SSLSocketFactory factory=(SSLSocketFactory) SSLSocketFactory.getDefault();
          SSLSocket sslsocket=(SSLSocket) factory.createSocket("127.0.0.1",1234);
  
          //Tao luong nhan va gui du lieu len server
          DataOutputStream os=new DataOutputStream(sslsocket.getOutputStream());
          DataInputStream is=new DataInputStream(sslsocket.getInputStream());
  
          //Gui du lieu len server
          String str="helloworld";
          os.writeBytes(str);
  
          //Nhan du lieu da qua xu li tu server ve
          String responseStr;
          if((responseStr=is.readUTF())!=null)
          {
              System.out.println(responseStr);
          }
  
          os.close();
          is.close();
          sslsocket.close();
          }
          catch(UnknownHostException e)
          {
               System.out.println(e.getMessage());
          }
          catch(IOException e)
          {
              System.out.println(e.getMessage());
          }
      }
  }
  </code></pre>
  
  <p>When run <code>SSLServer</code>. It displays this error:</p>
  
  <pre><code>javax.net.ssl.SSLException: No available certificate or key corresponds 
      to the SSL cipher suites which are enabled
  </code></pre>
  
  <p>I have search and do some ways but.. Can you help me.</p>