01: /*
02: * KSSL Wrapper for the Netlet Socket Factory. Creates Socket of type KSSLSocket
03: *
04: * @author Rajesh T
05: * @date 16-July-2003
06: */
07: package com.sun.portal.netlet.client.common;
08:
09: import java.net.Socket;
10:
11: public class KSSLSocketWrapper implements NetletSocketWrapper {
12:
13: /*
14: * Creates a new instance of KSSLSocketWrapper
15: */
16:
17: public KSSLSocketWrapper() {
18: }
19:
20: /*
21: */
22:
23: public void init(boolean requireClientCert) {
24: if (requireClientCert) {
25: throw new IllegalArgumentException(
26: "Gateway requires client certificate, The current"
27: + " Java Plugin on this browser does not support it, Consider using a higher version");
28: }
29: }
30:
31: /*
32: */
33:
34: public Socket getSocket(String destHost, int destPort,
35: String[] cipherSuites) {
36: try {
37: return new KSSLSocket(destHost, destPort, cipherSuites);
38: } catch (Exception e) {
39: e.printStackTrace();
40: }
41: return null;
42: }
43:
44: /*
45: */
46:
47: public Socket getSocket(Socket tunnelSocket, String host, int port,
48: String[] cipherSuites) {
49: try {
50: return new KSSLSocket(tunnelSocket, host, port,
51: cipherSuites);
52: } catch (Exception e) {
53: e.printStackTrace();
54: }
55: return null;
56: }
57:
58: /*
59: */
60:
61: public void cleanup() {
62: }
63: }
|