Changeset 143 for trunk/vnc/vnc_javasrc/VNCProxyConnectSocketFactory.java
- Timestamp:
- Oct 8, 2007, 4:35:12 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/vnc/vnc_javasrc/VNCProxyConnectSocketFactory.java
r66 r143 27 27 import java.applet.*; 28 28 import java.net.*; 29 import javax.net.ssl.*; 29 30 import java.io.*; 30 31 31 32 class VNCProxyConnectSocketFactory implements SocketFactory { 33 34 SSLSocketFactory factory; 35 36 public VNCProxyConnectSocketFactory() { 37 try { 38 SSLContext c = SSLContext.getInstance("SSL"); 39 c.init(null, 40 new TrustManager[] { new SIPBTrustManager() }, 41 null); 42 factory = 43 (SSLSocketFactory)c.getSocketFactory(); 44 } catch (Exception e) { 45 e.printStackTrace(); 46 } 47 } 32 48 33 49 public Socket createSocket(String host, int port, Applet applet) … … 58 74 System.out.println("VNCProxy CONNECT via proxy " + host + 59 75 " port " + port + " to vm " + vmname); 60 VNCProxyConnectSocket s = 61 new VNCProxyConnectSocket(host, port, vmname, authtoken); 76 SSLSocket ssls = (SSLSocket)factory.createSocket(host, port); 77 ssls.startHandshake(); 78 VNCProxyConnectSocketWrapper s = 79 new VNCProxyConnectSocketWrapper(ssls, vmname, authtoken); 62 80 63 81 return (Socket)s;
Note: See TracChangeset
for help on using the changeset viewer.