KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > rmijdbc > RJSSLServerSocketFactory


1 /*
2  * RMISSLServerSocketFactory.java
3  *
4  * Created on October 7, 2001, 6:17 PM
5  * @Author Douglas Hammond(djhammond@sympatico.ca)
6  */

7
8 package org.objectweb.rmijdbc;
9
10 import java.net.*;
11 import java.io.*;
12 import javax.net.ssl.*;
13 import java.rmi.server.*;
14
15
16 /**
17  * ServerSocketFactory with SSL support
18  */

19 public class RJSSLServerSocketFactory implements RMIServerSocketFactory, Serializable {
20     public ServerSocket createServerSocket(int serverPort)
21     throws IOException {
22             try {
23                 SSLServerSocketFactory factory =
24                     (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
25         
26                  SSLServerSocket sslSocket =
27                     (SSLServerSocket) factory.createServerSocket(serverPort);
28
29 // String [] cipherSuites = sslSocket.getEnabledCipherSuites();
30

31 // for (int i = 0; i < cipherSuites.length; i++) {
32
// System.out.println("Cipher Suite " + i +
33
// " = " + cipherSuites[i]);
34
// }
35
return sslSocket;
36         } catch(IOException e) {
37                 e.printStackTrace();
38                 System.exit(1);
39             }
40             return null;
41     }
42 }
43
Popular Tags