创建一个SSL服务器套接字
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.ServerSocket; /** 来 自 时 代 Java 公 众 号 - nowjava.com **/ import java.net.Socket; import javax.net.ServerSocketFactory; import javax.net.ssl.SSLServerSocketFactory; public class Main { public static void main(String[] argv) { try { int port = 443; ServerSocketFactory ssocketFactory = SSLServerSocketFactory.getDefault(); ServerSocket ssocket = ssocketFactory.createServerSocket(port); // Listen for connections Socket socket = ssocket.accept();/**来 自 NowJava.com**/ // Create streams to securely send and receive data to the client InputStream in = socket.getInputStream(); OutputStream out = socket.getOutputStream();