Client dasturi kodi
import com.sun.net.ssl.internal.ssl.Provider;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.security.Security;
import java.util.Scanner;
public class Client { public static void main(String args[]) {
Scanner sc = new Scanner (System.in);
int serverPort = 7712;
String serverName = "localhost";
Security.addProvider(new Provider());
System.setProperty ("javax.net.ssl.trustStore", "myTrustStore.jts");
System.setProperty ("javax.net.ssl.trustStorePassword", "your password");
//System.setProperty ("javax.net.debug","all");
try {
SSLSocketFactory sslsocketfactory = (SSLSocketFactory)
SSLSocketFactory.getDefault();
SSLSocket sslSocket = (SSLSocket) sslsocketfactory.createSocket(serverName,
serverPort);
DataOutputStream outputStream = new
DataOutputStream(sslSocket.getOutputStream());
DataInputStream inputStream = new DataInputStream(sslSocket.getInputStream());
System.err.println(inputStream.readUTF());
while (true) {
System.out.println ("Serverga yuboriladigan xabarni kiriting : ");
String messageToSend = sc.nextLine();
outputStream.writeUTF(messageToSend);
System.err.println(inputStream.readUTF());