summaryrefslogtreecommitdiffstats
path: root/classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch
blob: f4386558071636a5e42271ffdd6bd122830468b5 (plain)
ofshex dumpascii
0000 64 69 66 66 20 2d 78 20 56 6e 63 43 61 6e 76 61 73 2e 6a 61 76 61 20 2d 4e 61 75 72 20 76 6e 63 diff.-x.VncCanvas.java.-Naur.vnc
0020 5f 6a 61 76 61 73 72 63 2e 6f 72 69 67 2f 4d 61 6b 65 66 69 6c 65 20 76 6e 63 5f 6a 61 76 61 73 _javasrc.orig/Makefile.vnc_javas
0040 72 63 2f 4d 61 6b 65 66 69 6c 65 0a 2d 2d 2d 20 76 6e 63 5f 6a 61 76 61 73 72 63 2e 6f 72 69 67 rc/Makefile.---.vnc_javasrc.orig
0060 2f 4d 61 6b 65 66 69 6c 65 09 32 30 30 34 2d 30 33 2d 30 34 20 30 38 3a 33 34 3a 32 35 2e 30 30 /Makefile.2004-03-04.08:34:25.00
0080 30 30 30 30 30 30 30 20 2d 30 35 30 30 0a 2b 2b 2b 20 76 6e 63 5f 6a 61 76 61 73 72 63 2f 4d 61 0000000.-0500.+++.vnc_javasrc/Ma
00a0 6b 65 66 69 6c 65 09 32 30 30 36 2d 30 33 2d 32 36 20 31 37 3a 32 39 3a 32 35 2e 30 30 30 30 30 kefile.2006-03-26.17:29:25.00000
00c0 30 30 30 30 20 2d 30 35 30 30 0a 40 40 20 2d 31 35 2c 32 35 20 2b 31 35 2c 32 39 20 40 40 0a 20 0000.-0500.@@.-15,25.+15,29.@@..
00e0 09 20 20 44 65 73 43 69 70 68 65 72 2e 63 6c 61 73 73 20 43 61 70 61 62 69 6c 69 74 79 49 6e 66 ...DesCipher.class.CapabilityInf
0100 6f 2e 63 6c 61 73 73 20 43 61 70 73 43 6f 6e 74 61 69 6e 65 72 2e 63 6c 61 73 73 20 5c 0a 20 09 o.class.CapsContainer.class.\...
0120 20 20 52 65 63 6f 72 64 69 6e 67 46 72 61 6d 65 2e 63 6c 61 73 73 20 53 65 73 73 69 6f 6e 52 65 ..RecordingFrame.class.SessionRe
0140 63 6f 72 64 65 72 2e 63 6c 61 73 73 20 41 75 74 68 55 6e 69 78 4c 6f 67 69 6e 50 61 6e 65 6c 2e corder.class.AuthUnixLoginPanel.
0160 63 6c 61 73 73 20 5c 0a 20 09 20 20 53 6f 63 6b 65 74 46 61 63 74 6f 72 79 2e 63 6c 61 73 73 20 class.\.....SocketFactory.class.
0180 48 54 54 50 43 6f 6e 6e 65 63 74 53 6f 63 6b 65 74 46 61 63 74 6f 72 79 2e 63 6c 61 73 73 20 5c HTTPConnectSocketFactory.class.\
01a0 0a 2d 09 20 20 48 54 54 50 43 6f 6e 6e 65 63 74 53 6f 63 6b 65 74 2e 63 6c 61 73 73 20 52 65 6c .-...HTTPConnectSocket.class.Rel
01c0 6f 67 69 6e 50 61 6e 65 6c 2e 63 6c 61 73 73 0a 2b 09 20 20 48 54 54 50 43 6f 6e 6e 65 63 74 53 oginPanel.class.+...HTTPConnectS
01e0 6f 63 6b 65 74 2e 63 6c 61 73 73 20 52 65 6c 6f 67 69 6e 50 61 6e 65 6c 2e 63 6c 61 73 73 20 5c ocket.class.ReloginPanel.class.\
0200 0a 2b 09 20 20 53 53 4c 53 6f 63 6b 65 74 54 6f 4d 65 2e 63 6c 61 73 73 0a 2b 0a 2b 53 53 4c 5f .+...SSLSocketToMe.class.+.+SSL_
0220 43 4c 41 53 53 45 53 20 3d 20 53 53 4c 53 6f 63 6b 65 74 54 6f 4d 65 2a 2e 63 6c 61 73 73 20 54 CLASSES.=.SSLSocketToMe*.class.T
0240 72 75 73 74 44 69 61 6c 6f 67 2e 63 6c 61 73 73 0a 20 0a 20 53 4f 55 52 43 45 53 20 3d 20 56 6e rustDialog.class....SOURCES.=.Vn
0260 63 56 69 65 77 65 72 2e 6a 61 76 61 20 52 66 62 50 72 6f 74 6f 2e 6a 61 76 61 20 41 75 74 68 50 cViewer.java.RfbProto.java.AuthP
0280 61 6e 65 6c 2e 6a 61 76 61 20 56 6e 63 43 61 6e 76 61 73 2e 6a 61 76 61 20 5c 0a 20 09 20 20 4f anel.java.VncCanvas.java.\.....O
02a0 70 74 69 6f 6e 73 46 72 61 6d 65 2e 6a 61 76 61 20 43 6c 69 70 62 6f 61 72 64 46 72 61 6d 65 2e ptionsFrame.java.ClipboardFrame.
02c0 6a 61 76 61 20 42 75 74 74 6f 6e 50 61 6e 65 6c 2e 6a 61 76 61 20 5c 0a 20 09 20 20 44 65 73 43 java.ButtonPanel.java.\.....DesC
02e0 69 70 68 65 72 2e 6a 61 76 61 20 43 61 70 61 62 69 6c 69 74 79 49 6e 66 6f 2e 6a 61 76 61 20 43 ipher.java.CapabilityInfo.java.C
0300 61 70 73 43 6f 6e 74 61 69 6e 65 72 2e 6a 61 76 61 20 5c 0a 20 09 20 20 52 65 63 6f 72 64 69 6e apsContainer.java.\.....Recordin
0320 67 46 72 61 6d 65 2e 6a 61 76 61 20 53 65 73 73 69 6f 6e 52 65 63 6f 72 64 65 72 2e 6a 61 76 61 gFrame.java.SessionRecorder.java
0340 20 41 75 74 68 55 6e 69 78 4c 6f 67 69 6e 50 61 6e 65 6c 2e 6a 61 76 61 20 5c 0a 20 09 20 20 53 .AuthUnixLoginPanel.java.\.....S
0360 6f 63 6b 65 74 46 61 63 74 6f 72 79 2e 6a 61 76 61 20 48 54 54 50 43 6f 6e 6e 65 63 74 53 6f 63 ocketFactory.java.HTTPConnectSoc
0380 6b 65 74 46 61 63 74 6f 72 79 2e 6a 61 76 61 20 5c 0a 2d 09 20 20 48 54 54 50 43 6f 6e 6e 65 63 ketFactory.java.\.-...HTTPConnec
03a0 74 53 6f 63 6b 65 74 2e 6a 61 76 61 20 52 65 6c 6f 67 69 6e 50 61 6e 65 6c 2e 6a 61 76 61 0a 2b tSocket.java.ReloginPanel.java.+
03c0 09 20 20 48 54 54 50 43 6f 6e 6e 65 63 74 53 6f 63 6b 65 74 2e 6a 61 76 61 20 52 65 6c 6f 67 69 ...HTTPConnectSocket.java.Relogi
03e0 6e 50 61 6e 65 6c 2e 6a 61 76 61 20 5c 0a 2b 09 20 20 53 53 4c 53 6f 63 6b 65 74 54 6f 4d 65 2e nPanel.java.\.+...SSLSocketToMe.
0400 6a 61 76 61 0a 20 0a 20 61 6c 6c 3a 20 24 28 43 4c 41 53 53 45 53 29 20 24 28 41 52 43 48 49 56 java....all:.$(CLASSES).$(ARCHIV
0420 45 29 0a 20 0a 20 24 28 43 4c 41 53 53 45 53 29 3a 20 24 28 53 4f 55 52 43 45 53 29 0a 2d 09 24 E)....$(CLASSES):.$(SOURCES).-.$
0440 28 4a 43 29 20 2d 74 61 72 67 65 74 20 31 2e 31 20 2d 4f 20 24 28 53 4f 55 52 43 45 53 29 0a 2b (JC).-target.1.1.-O.$(SOURCES).+
0460 09 24 28 4a 43 29 20 2d 74 61 72 67 65 74 20 31 2e 34 20 2d 4f 20 24 28 53 4f 55 52 43 45 53 29 .$(JC).-target.1.4.-O.$(SOURCES)
0480 0a 20 0a 20 24 28 41 52 43 48 49 56 45 29 3a 20 24 28 43 4c 41 53 53 45 53 29 20 24 28 4d 41 4e ....$(ARCHIVE):.$(CLASSES).$(MAN
04a0 49 46 45 53 54 29 0a 2d 09 24 28 4a 41 52 29 20 63 66 6d 20 24 28 41 52 43 48 49 56 45 29 20 24 IFEST).-.$(JAR).cfm.$(ARCHIVE).$
04c0 28 4d 41 4e 49 46 45 53 54 29 20 24 28 43 4c 41 53 53 45 53 29 0a 2b 09 24 28 4a 41 52 29 20 63 (MANIFEST).$(CLASSES).+.$(JAR).c
04e0 66 6d 20 24 28 41 52 43 48 49 56 45 29 20 24 28 4d 41 4e 49 46 45 53 54 29 20 24 28 43 4c 41 53 fm.$(ARCHIVE).$(MANIFEST).$(CLAS
0500 53 45 53 29 20 24 28 53 53 4c 5f 43 4c 41 53 53 45 53 29 0a 20 0a 20 69 6e 73 74 61 6c 6c 3a 20 SES).$(SSL_CLASSES)....install:.
0520 24 28 43 4c 41 53 53 45 53 29 20 24 28 41 52 43 48 49 56 45 29 0a 2d 09 24 28 43 50 29 20 24 28 $(CLASSES).$(ARCHIVE).-.$(CP).$(
0540 43 4c 41 53 53 45 53 29 20 24 28 41 52 43 48 49 56 45 29 20 24 28 50 41 47 45 53 29 20 24 28 49 CLASSES).$(ARCHIVE).$(PAGES).$(I
0560 4e 53 54 41 4c 4c 5f 44 49 52 29 0a 2b 09 24 28 43 50 29 20 24 28 43 4c 41 53 53 45 53 29 20 24 NSTALL_DIR).+.$(CP).$(CLASSES).$
0580 28 53 53 4c 5f 43 4c 41 53 53 45 53 29 20 24 28 41 52 43 48 49 56 45 29 20 24 28 50 41 47 45 53 (SSL_CLASSES).$(ARCHIVE).$(PAGES
05a0 29 20 24 28 49 4e 53 54 41 4c 4c 5f 44 49 52 29 0a 20 0a 20 65 78 70 6f 72 74 3a 3a 20 24 28 43 ).$(INSTALL_DIR)....export::.$(C
05c0 4c 41 53 53 45 53 29 20 24 28 41 52 43 48 49 56 45 29 20 24 28 50 41 47 45 53 29 0a 20 09 40 24 LASSES).$(ARCHIVE).$(PAGES)...@$
05e0 28 45 78 70 6f 72 74 4a 61 76 61 43 6c 61 73 73 65 73 29 0a 64 69 66 66 20 2d 78 20 56 6e 63 43 (ExportJavaClasses).diff.-x.VncC
0600 61 6e 76 61 73 2e 6a 61 76 61 20 2d 4e 61 75 72 20 76 6e 63 5f 6a 61 76 61 73 72 63 2e 6f 72 69 anvas.java.-Naur.vnc_javasrc.ori
0620 67 2f 50 31 35 39 33 34 2e 64 69 72 20 76 6e 63 5f 6a 61 76 61 73 72 63 2f 50 31 35 39 33 34 2e g/P15934.dir.vnc_javasrc/P15934.
0640 64 69 72 0a 2d 2d 2d 20 76 6e 63 5f 6a 61 76 61 73 72 63 2e 6f 72 69 67 2f 50 31 35 39 33 34 2e dir.---.vnc_javasrc.orig/P15934.
0660 64 69 72 09 31 39 36 39 2d 31 32 2d 33 31 20 31 39 3a 30 30 3a 30 30 2e 30 30 30 30 30 30 30 30 dir.1969-12-31.19:00:00.00000000
0680 30 20 2d 30 35 30 30 0a 2b 2b 2b 20 76 6e 63 5f 6a 61 76 61 73 72 63 2f 50 31 35 39 33 34 2e 64 0.-0500.+++.vnc_javasrc/P15934.d
06a0 69 72 09 32 30 30 37 2d 30 34 2d 32 39 20 32 30 3a 33 32 3a 34 39 2e 30 30 30 30 30 30 30 30 30 ir.2007-04-29.20:32:49.000000000
06c0 20 2d 30 34 30 30 0a 40 40 20 2d 30 2c 30 20 2b 31 2c 36 20 40 40 0a 2b 30 82 04 be 02 01 00 30 .-0400.@@.-0,0.+1,6.@@.+0......0
06e0 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 04 82 04 a8 30 82 04 a4 02 01 00 02 82 01 01 00 c8 a2 ...*.H............0.............
0700 81 49 2a ba 78 c2 35 3a e1 bc b0 1e 73 b1 39 dd d1 80 3d 49 07 7e 1d 80 2b 6a 0a 2b 93 44 a7 c3 .I*.x.5:....s.9...=I.~..+j.+.D..
0720 81 a9 0b 11 39 1a 5f 24 aa f5 92 f9 17 5c 71 1e 6c 06 8f 18 e1 29 03 82 71 6a 7c 2f f7 bd 0a 2b ....9._$.....\q.l....)..qj|/...+
0740 2d 8e 9f 5a 67 3c df c7 ff d5 6b 59 5f 3d 98 c3 6f 5f 86 4f a7 85 23 ca c1 58 a6 ed 3a 93 4c cb -..Zg<....kY_=..o_.O..#..X..:.L.
0760 e7 d1 b8 67 51 41 76 89 a4 72 78 79 d6 e1 f1 e8 94 01 26 ae 47 77 df ed a0 cf 14 e6 a3 39 c2 a3 ...gQAv..rxy......&.Gw.......9..
0780 56 e2 6b b0 16 d7 47 40 ba 35 5a ab ed 0a 2b 85 13 3e 5d 3d 39 ac ad a6 3c d2 a8 22 fa b7 d6 19 V.k...G@.5Z...+..>]=9...<.."....
07a0 18 76 f4 a9 37 7a d2 77 99 a6 6e ac ae f4 88 8a d3 17 59 d0 c3 6b 4f cd ab c9 eb a0 9b 3f 1e c2 .v..7z.w..n.......Y..kO......?..
07c0 e4 2c 11 87 9c ee 4c d2 53 31 43 12 b2 51 02 29 44 65 9f 1c 81 2a b0 d4 f7 a8 20 c3 fe 50 e6 64 .,....L.S1C..Q.)De...*.......P.d
07e0 b9 3b 6a 9a 96 2a c9 13 49 0b 47 9a 1e f8 22 11 76 b5 9c aa 40 04 2b bb fd b0 9a de cc a1 2e d0 .;j..*..I.G...".v...@.+.........
0800 6d 02 03 01 00 01 02 82 01 00 7a 35 39 c8 c6 65 04 cf 4e bb 09 ea f3 df e8 9a 67 e3 ec 0b 4f c9 m.........z59..e..N.......g...O.
0820 1e ee 3b ab e9 45 d3 21 36 ed 75 11 92 54 f2 6d b4 d9 85 2d 39 1e 07 e9 a9 de 21 28 ad aa 15 fe ..;..E.!6.u..T.m...-9.....!(....
0840 78 0b f2 35 81 26 19 d5 ad e8 f8 2c ea 75 97 72 a5 e0 5d bd b2 80 a2 99 93 66 5f 7d 71 03 2d c7 x..5.&.....,.u.r..]......f_}q.-.
0860 d4 30 59 2a d5 aa a4 46 3a bd ec fb 7a 76 3c 31 42 b1 be 60 17 70 27 6a 42 fe 66 c0 78 be 29 3c .0Y*...F:...zv<1B..`.p'jB.f.x.)<
0880 24 42 ca f3 b8 08 70 1d eb a6 9c 5a 5e 37 03 50 1e 01 93 f5 8e 47 3a 16 9a 5e 01 c9 4d 58 ea 77 $B....p....Z^7.P.....G:..^..MX.w
08a0 7f 10 3b 5e 18 6f 7a a5 35 cc 31 cd 8d 39 95 2f e8 72 49 7f 69 57 68 9e e2 55 be 4e 0b b1 a5 93 ..;^.oz.5.1..9./.rI.iWh..U.N....
08c0 69 75 98 20 ee fc ad ac 7f 40 f0 55 32 9e ed 38 b3 8b 17 90 c9 10 7a 2d 95 5c 1e 12 5f de af 93 iu.......@.U2..8......z-.\.._...
08e0 f5 6a b8 d8 9a 0b a2 8e 0a 2b 9f 58 0b f7 5e 64 99 82 83 d1 e7 9e a6 16 1d 14 3f 75 73 35 b5 e5 .j.......+.X..^d..........?us5..
0900 28 13 e9 65 44 b6 69 00 42 b8 41 02 81 81 00 e3 bd 50 48 c7 01 32 59 9d b2 55 39 ef 53 7b 4a a0 (..eD.i.B.A......PH..2Y..U9.S{J.
0920 bb da fa 09 d6 84 d1 fe 93 97 40 de d7 5e ee e0 1c 6c 57 36 26 a7 ed 9f e6 0c e9 4c 7b 33 2c f6 ..........@..^...lW6&......L{3,.
0940 49 49 c3 e3 6d 8d 48 ea f3 fa d7 13 c1 dc 33 7b 88 8d 42 4c 67 8e 8e 4a 43 47 39 c4 04 e2 b5 4f II..m.H.......3{..BLg..JCG9....O
0960 be 02 82 87 7d 8d 16 5c 53 95 07 c8 0f 09 9a 54 3f bf d3 62 aa 51 78 42 9b 47 ae 49 67 cf bf 72 ....}..\S......T?..b.QxB.G.Ig..r
0980 7f 58 cf 8a 8f 22 49 c5 db a2 fe bc 99 1f 1d 02 81 81 00 e1 88 25 43 a8 9f 8b 27 5e a5 e8 09 66 .X..."I..............%C...'^...f
09a0 3a 80 63 4f 0e 77 c3 43 8a 6d 85 9e 7f 66 76 7c 30 33 56 f3 6a f2 8f be 80 7c c8 6a 8a 2b b1 18 :.cO.w.C.m...fv|03V.j....|.j.+..
09c0 be e2 dd 4b c5 1d f6 3a f0 be a0 35 18 c8 5d e8 fb 1f 6f 98 11 93 29 70 7c 63 64 95 c2 a1 4f 6c ...K...:...5..]...o...)p|cd...Ol
09e0 36 52 74 f9 b5 d7 04 5e 2a b3 42 da ec a8 b9 91 9f 68 6c d9 3a e0 bf 90 06 c0 a7 17 22 19 71 84 6Rt....^*.B......hl.:.......".q.
0a00 8a b8 a9 15 c1 f1 e2 9b 99 c8 df aa 4b b9 97 25 b9 25 91 02 81 80 0b 78 8c a3 ad ca 64 a3 d8 ea ............K..%.%.....x....d...
0a20 93 9a 60 70 9f 04 2a 46 6c 08 2e 18 ad 05 fa c1 aa 5b ad 1d c1 fd 5c 32 72 4e 8e 3e b2 34 a8 da ..`p..*Fl........[....\2rN.>.4..
0a40 28 8a 53 bc dc de 05 e5 b9 1e 71 c5 21 d9 ab 63 f0 9d 86 b4 3c 08 27 cf bf f5 b7 ed 7b 63 b5 5f (.S.......q.!..c....<.'.....{c._
0a60 e0 25 8b b7 07 48 44 a4 f8 71 64 ab b1 40 90 13 f1 ac bb a9 ee 3c e4 c3 75 41 0b 76 32 b6 50 fc .%...HD..qd..@.......<..uA.v2.P.
0a80 8b 46 bf 11 c8 88 07 17 5c fc cf 28 d8 7c 48 c8 00 54 be 61 24 0d 02 81 81 00 88 42 e5 a0 d7 44 .F......\..(.|H..T.a$......B...D
0aa0 6d a2 bf c0 a5 4c e8 82 f8 07 08 40 c9 83 24 4f 82 94 74 8a ac b1 71 9e fd a5 cf 34 12 91 5e 9b m....L.....@..$O..t...q....4..^.
0ac0 ea c8 7b f6 37 27 ac b7 c8 01 c4 41 b8 34 88 af e3 bc 8f d8 05 57 17 e8 81 b9 be ba ff 9a cd e7 ..{.7'.....A.4.......W..........
0ae0 99 75 b0 36 03 98 24 dd 3d 3c 87 92 a1 f2 75 a2 7e e4 29 b9 4a c7 b3 80 08 6b 9b 63 c3 5e 79 fa .u.6..$.=<....u.~.).J....k.c.^y.
0b00 5a 73 99 ba 74 7c ed 83 92 c6 35 eb 13 e5 c1 f5 4c 34 36 83 c2 01 dc 3c dc c1 02 81 81 00 db 56 Zs..t|....5.....L46....<.......V
0b20 bf 2c c2 16 3b 1f d1 98 4b 7a 27 9c 5d c9 d0 64 65 00 85 81 78 c2 bc de 2a 95 56 1f 8d 28 a5 7f .,..;...Kz'.]..de...x...*.V..(..
0b40 cd fb 23 ec af 2d 0a 2b 1a 11 db 5d 0d 17 f0 a3 29 2d 6a b3 89 19 f2 43 96 f4 55 65 39 a4 2b cc ..#..-.+...]....)-j....C..Ue9.+.
0b60 8e 4b 34 ba 18 72 cb b8 25 1b 52 95 3d 4a 3b d0 ec 3c 0b 37 09 67 9d 57 6f 83 ba f6 0c 89 e7 57 .K4..r..%.R.=J;..<.7.g.Wo......W
0b80 d2 4a 99 1a aa cf 9c db 48 b4 61 80 8e a5 ed a0 a1 90 99 78 a0 45 3f 96 30 9f 58 64 57 6d 18 0a .J......H.a........x.E?.0.XdWm..
0ba0 5c 20 4e 6f 20 6e 65 77 6c 69 6e 65 20 61 74 20 65 6e 64 20 6f 66 20 66 69 6c 65 0a 64 69 66 66 \.No.newline.at.end.of.file.diff
0bc0 20 2d 78 20 56 6e 63 43 61 6e 76 61 73 2e 6a 61 76 61 20 2d 4e 61 75 72 20 76 6e 63 5f 6a 61 76 .-x.VncCanvas.java.-Naur.vnc_jav
0be0 61 73 72 63 2e 6f 72 69 67 2f 52 66 62 50 72 6f 74 6f 2e 6a 61 76 61 20 76 6e 63 5f 6a 61 76 61 asrc.orig/RfbProto.java.vnc_java
0c00 73 72 63 2f 52 66 62 50 72 6f 74 6f 2e 6a 61 76 61 0a 2d 2d 2d 20 76 6e 63 5f 6a 61 76 61 73 72 src/RfbProto.java.---.vnc_javasr
0c20 63 2e 6f 72 69 67 2f 52 66 62 50 72 6f 74 6f 2e 6a 61 76 61 09 32 30 30 34 2d 30 33 2d 30 34 20 c.orig/RfbProto.java.2004-03-04.
0c40 30 38 3a 33 34 3a 32 35 2e 30 30 30 30 30 30 30 30 30 20 2d 30 35 30 30 0a 2b 2b 2b 20 76 6e 63 08:34:25.000000000.-0500.+++.vnc
0c60 5f 6a 61 76 61 73 72 63 2f 52 66 62 50 72 6f 74 6f 2e 6a 61 76 61 09 32 30 30 36 2d 30 34 2d 31 _javasrc/RfbProto.java.2006-04-1
0c80 36 20 31 31 3a 31 37 3a 33 37 2e 30 30 30 30 30 30 30 30 30 20 2d 30 34 30 30 0a 40 40 20 2d 31 6.11:17:37.000000000.-0400.@@.-1
0ca0 39 39 2c 37 20 2b 31 39 39 2c 32 31 20 40 40 0a 20 20 20 20 20 68 6f 73 74 20 3d 20 68 3b 0a 20 99,7.+199,21.@@......host.=.h;..
0cc0 20 20 20 20 70 6f 72 74 20 3d 20 70 3b 0a 20 0a 2d 20 20 20 20 69 66 20 28 76 69 65 77 65 72 2e ....port.=.p;...-....if.(viewer.
0ce0 73 6f 63 6b 65 74 46 61 63 74 6f 72 79 20 3d 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 20 20 20 20 69 66 socketFactory.==.null).{.+....if
0d00 20 28 21 20 76 69 65 77 65 72 2e 64 69 73 61 62 6c 65 53 53 4c 29 20 7b 0a 2b 09 53 79 73 74 65 .(!.viewer.disableSSL).{.+.Syste
0d20 6d 2e 6f 75 74 2e 70 72 69 6e 74 6c 6e 28 22 6e 65 77 20 53 53 4c 53 6f 63 6b 65 74 54 6f 4d 65 m.out.println("new.SSLSocketToMe
0d40 22 29 3b 0a 2b 09 53 53 4c 53 6f 63 6b 65 74 54 6f 4d 65 20 73 73 6c 3b 0a 2b 09 74 72 79 20 7b ");.+.SSLSocketToMe.ssl;.+.try.{
0d60 0a 2b 09 09 73 73 6c 20 3d 20 6e 65 77 20 53 53 4c 53 6f 63 6b 65 74 54 6f 4d 65 28 68 6f 73 74 .+..ssl.=.new.SSLSocketToMe(host
0d80 2c 20 70 6f 72 74 2c 20 76 29 3b 0a 2b 09 7d 20 63 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e ,.port,.v);.+.}.catch.(Exception
0da0 20 65 29 20 7b 0a 2b 09 09 74 68 72 6f 77 20 6e 65 77 20 49 4f 45 78 63 65 70 74 69 6f 6e 28 65 .e).{.+..throw.new.IOException(e
0dc0 2e 67 65 74 4d 65 73 73 61 67 65 28 29 29 3b 0a 2b 09 7d 0a 2b 0a 2b 09 74 72 79 20 7b 0a 2b 09 .getMessage());.+.}.+.+.try.{.+.
0de0 09 73 6f 63 6b 20 3d 20 73 73 6c 2e 63 6f 6e 6e 65 63 74 53 6f 63 6b 28 29 3b 0a 2b 09 7d 20 63 .sock.=.ssl.connectSock();.+.}.c
0e00 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 65 73 29 20 7b 0a 2b 09 09 74 68 72 6f 77 20 6e atch.(Exception.es).{.+..throw.n
0e20 65 77 20 49 4f 45 78 63 65 70 74 69 6f 6e 28 65 73 2e 67 65 74 4d 65 73 73 61 67 65 28 29 29 3b ew.IOException(es.getMessage());
0e40 0a 2b 09 7d 0a 2b 20 20 20 20 7d 20 65 6c 73 65 20 69 66 20 28 76 69 65 77 65 72 2e 73 6f 63 6b .+.}.+....}.else.if.(viewer.sock
0e60 65 74 46 61 63 74 6f 72 79 20 3d 3d 20 6e 75 6c 6c 29 20 7b 0a 20 20 20 20 20 20 20 73 6f 63 6b etFactory.==.null).{........sock
0e80 20 3d 20 6e 65 77 20 53 6f 63 6b 65 74 28 68 6f 73 74 2c 20 70 6f 72 74 29 3b 0a 20 20 20 20 20 .=.new.Socket(host,.port);......
0ea0 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 74 72 79 20 7b 0a 40 40 20 2d 32 35 35 2c 37 20 }.else.{........try.{.@@.-255,7.
0ec0 2b 32 36 39 2c 37 20 40 40 0a 20 09 7c 7c 20 28 62 5b 31 30 5d 20 3c 20 27 30 27 29 20 7c 7c 20 +269,7.@@...||.(b[10].<.'0').||.
0ee0 28 62 5b 31 30 5d 20 3e 20 27 39 27 29 20 7c 7c 20 28 62 5b 31 31 5d 20 21 3d 20 27 5c 6e 27 29 (b[10].>.'9').||.(b[11].!=.'\n')
0f00 29 0a 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 )......{........throw.new.Except
0f20 69 6f 6e 28 22 48 6f 73 74 20 22 20 2b 20 68 6f 73 74 20 2b 20 22 20 70 6f 72 74 20 22 20 2b 20 ion("Host.".+.host.+.".port.".+.
0f40 70 6f 72 74 20 2b 0a 2d 09 09 09 20 20 22 20 69 73 20 6e 6f 74 20 61 6e 20 52 46 42 20 73 65 72 port.+.-.....".is.not.an.RFB.ser
0f60 76 65 72 22 29 3b 0a 2b 09 09 09 20 20 22 20 69 73 20 6e 6f 74 20 61 6e 20 52 46 42 20 73 65 72 ver");.+.....".is.not.an.RFB.ser
0f80 76 65 72 3a 20 22 20 2b 20 62 29 3b 0a 20 20 20 20 20 7d 0a 20 0a 20 20 20 20 20 73 65 72 76 65 ver:.".+.b);......}........serve
0fa0 72 4d 61 6a 6f 72 20 3d 20 28 62 5b 34 5d 20 2d 20 27 30 27 29 20 2a 20 31 30 30 20 2b 20 28 62 rMajor.=.(b[4].-.'0').*.100.+.(b
0fc0 5b 35 5d 20 2d 20 27 30 27 29 20 2a 20 31 30 20 2b 20 28 62 5b 36 5d 20 2d 20 27 30 27 29 3b 0a [5].-.'0').*.10.+.(b[6].-.'0');.
0fe0 64 69 66 66 20 2d 78 20 56 6e 63 43 61 6e 76 61 73 2e 6a 61 76 61 20 2d 4e 61 75 72 20 76 6e 63 diff.-x.VncCanvas.java.-Naur.vnc
1000 5f 6a 61 76 61 73 72 63 2e 6f 72 69 67 2f 53 53 4c 53 6f 63 6b 65 74 54 6f 4d 65 2e 6a 61 76 61 _javasrc.orig/SSLSocketToMe.java
1020 20 76 6e 63 5f 6a 61 76 61 73 72 63 2f 53 53 4c 53 6f 63 6b 65 74 54 6f 4d 65 2e 6a 61 76 61 0a .vnc_javasrc/SSLSocketToMe.java.
1040 2d 2d 2d 20 76 6e 63 5f 6a 61 76 61 73 72 63 2e 6f 72 69 67 2f 53 53 4c 53 6f 63 6b 65 74 54 6f ---.vnc_javasrc.orig/SSLSocketTo
1060 4d 65 2e 6a 61 76 61 09 31 39 36 39 2d 31 32 2d 33 31 20 31 39 3a 30 30 3a 30 30 2e 30 30 30 30 Me.java.1969-12-31.19:00:00.0000
1080 30 30 30 30 30 20 2d 30 35 30 30 0a 2b 2b 2b 20 76 6e 63 5f 6a 61 76 61 73 72 63 2f 53 53 4c 53 00000.-0500.+++.vnc_javasrc/SSLS
10a0 6f 63 6b 65 74 54 6f 4d 65 2e 6a 61 76 61 09 32 30 30 37 2d 30 34 2d 32 39 20 32 30 3a 34 30 3a ocketToMe.java.2007-04-29.20:40:
10c0 33 35 2e 30 30 30 30 30 30 30 30 30 20 2d 30 34 30 30 0a 40 40 20 2d 30 2c 30 20 2b 31 2c 31 34 35.000000000.-0400.@@.-0,0.+1,14
10e0 32 31 20 40 40 0a 2b 2f 2a 0a 2b 20 2a 20 53 53 4c 53 6f 63 6b 65 74 54 6f 4d 65 2e 6a 61 76 61 21.@@.+/*.+.*.SSLSocketToMe.java
1100 3a 20 61 64 64 20 53 53 4c 20 65 6e 63 72 79 70 74 69 6f 6e 20 74 6f 20 4a 61 76 61 20 56 4e 43 :.add.SSL.encryption.to.Java.VNC
1120 20 56 69 65 77 65 72 2e 0a 2b 20 2a 0a 2b 20 2a 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 .Viewer..+.*.+.*.Copyright.(c).2
1140 30 30 36 20 4b 61 72 6c 20 4a 2e 20 52 75 6e 67 65 20 3c 72 75 6e 67 65 40 6b 61 72 6c 72 75 6e 006.Karl.J..Runge.<runge@karlrun
1160 67 65 2e 63 6f 6d 3e 0a 2b 20 2a 20 41 6c 6c 20 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64 2e ge.com>.+.*.All.rights.reserved.
1180 0a 2b 20 2a 0a 2b 20 2a 20 20 54 68 69 73 20 69 73 20 66 72 65 65 20 73 6f 66 74 77 61 72 65 3b .+.*.+.*..This.is.free.software;
11a0 20 79 6f 75 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75 74 65 20 69 74 20 61 6e 64 2f 6f 72 20 .you.can.redistribute.it.and/or.
11c0 6d 6f 64 69 66 79 0a 2b 20 2a 20 20 69 74 20 75 6e 64 65 72 20 74 68 65 20 74 65 72 6d 73 20 6f modify.+.*..it.under.the.terms.o
11e0 66 20 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 f.the.GNU.General.Public.License
1200 20 61 73 20 70 75 62 6c 69 73 68 65 64 20 62 79 0a 2b 20 2a 20 20 74 68 65 20 46 72 65 65 20 53 .as.published.by.+.*..the.Free.S
1220 6f 66 74 77 61 72 65 20 46 6f 75 6e 64 61 74 69 6f 6e 3b 20 76 65 72 73 69 6f 6e 20 32 20 6f 66 oftware.Foundation;.version.2.of
1240 20 74 68 65 20 4c 69 63 65 6e 73 65 2e 0a 2b 20 2a 0a 2b 20 2a 20 20 54 68 69 73 20 73 6f 66 74 .the.License..+.*.+.*..This.soft
1260 77 61 72 65 20 69 73 20 64 69 73 74 72 69 62 75 74 65 64 20 69 6e 20 74 68 65 20 68 6f 70 65 20 ware.is.distributed.in.the.hope.
1280 74 68 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20 75 73 65 66 75 6c 2c 0a 2b 20 2a 20 20 62 75 74 that.it.will.be.useful,.+.*..but
12a0 20 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 52 52 41 4e 54 59 3b 20 77 69 74 68 6f 75 74 20 65 .WITHOUT.ANY.WARRANTY;.without.e
12c0 76 65 6e 20 74 68 65 20 69 6d 70 6c 69 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 0a 2b 20 2a 20 ven.the.implied.warranty.of.+.*.
12e0 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 .MERCHANTABILITY.or.FITNESS.FOR.
1300 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 50 4f 53 45 2e 20 20 53 65 65 20 74 68 65 0a 2b A.PARTICULAR.PURPOSE...See.the.+
1320 20 2a 20 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 .*..GNU.General.Public.License.f
1340 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0a 2b 20 2a 0a 2b 20 2a 20 20 59 6f 75 20 73 68 or.more.details..+.*.+.*..You.sh
1360 6f 75 6c 64 20 68 61 76 65 20 72 65 63 65 69 76 65 64 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 ould.have.received.a.copy.of.the
1380 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 0a 2b 20 2a 20 .GNU.General.Public.License.+.*.
13a0 20 61 6c 6f 6e 67 20 77 69 74 68 20 74 68 69 73 20 73 6f 66 74 77 61 72 65 3b 20 69 66 20 6e 6f .along.with.this.software;.if.no
13c0 74 2c 20 77 72 69 74 65 20 74 6f 20 74 68 65 20 46 72 65 65 20 53 6f 66 74 77 61 72 65 0a 2b 20 t,.write.to.the.Free.Software.+.
13e0 2a 20 20 46 6f 75 6e 64 61 74 69 6f 6e 2c 20 49 6e 63 2e 2c 20 35 39 20 54 65 6d 70 6c 65 20 50 *..Foundation,.Inc.,.59.Temple.P
1400 6c 61 63 65 20 2d 20 53 75 69 74 65 20 33 33 30 2c 20 42 6f 73 74 6f 6e 2c 20 4d 41 20 20 30 32 lace.-.Suite.330,.Boston,.MA..02
1420 31 31 31 2d 31 33 30 37 2c 0a 2b 20 2a 20 20 55 53 41 2e 0a 2b 20 2a 0a 2b 20 2a 2f 0a 2b 0a 2b 111-1307,.+.*..USA..+.*.+.*/.+.+
1440 69 6d 70 6f 72 74 20 6a 61 76 61 2e 6e 65 74 2e 2a 3b 0a 2b 69 6d 70 6f 72 74 20 6a 61 76 61 2e import.java.net.*;.+import.java.
1460 69 6f 2e 2a 3b 0a 2b 69 6d 70 6f 72 74 20 6a 61 76 61 78 2e 6e 65 74 2e 73 73 6c 2e 2a 3b 0a 2b io.*;.+import.javax.net.ssl.*;.+
1480 69 6d 70 6f 72 74 20 6a 61 76 61 2e 75 74 69 6c 2e 2a 3b 0a 2b 0a 2b 69 6d 70 6f 72 74 20 6a 61 import.java.util.*;.+.+import.ja
14a0 76 61 2e 73 65 63 75 72 69 74 79 2e 2a 3b 0a 2b 69 6d 70 6f 72 74 20 6a 61 76 61 2e 73 65 63 75 va.security.*;.+import.java.secu
14c0 72 69 74 79 2e 63 65 72 74 2e 2a 3b 0a 2b 69 6d 70 6f 72 74 20 6a 61 76 61 2e 73 65 63 75 72 69 rity.cert.*;.+import.java.securi
14e0 74 79 2e 73 70 65 63 2e 2a 3b 0a 2b 69 6d 70 6f 72 74 20 6a 61 76 61 2e 73 65 63 75 72 69 74 79 ty.spec.*;.+import.java.security
1500 2e 63 65 72 74 2e 43 65 72 74 69 66 69 63 61 74 65 3b 0a 2b 69 6d 70 6f 72 74 20 6a 61 76 61 2e .cert.Certificate;.+import.java.
1520 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 43 65 72 74 69 66 69 63 61 74 65 46 61 63 74 6f 72 79 security.cert.CertificateFactory
1540 3b 0a 2b 0a 2b 69 6d 70 6f 72 74 20 6a 61 76 61 2e 61 77 74 2e 2a 3b 0a 2b 69 6d 70 6f 72 74 20 ;.+.+import.java.awt.*;.+import.
1560 6a 61 76 61 2e 61 77 74 2e 65 76 65 6e 74 2e 2a 3b 0a 2b 0a 2b 70 75 62 6c 69 63 20 63 6c 61 73 java.awt.event.*;.+.+public.clas
1580 73 20 53 53 4c 53 6f 63 6b 65 74 54 6f 4d 65 20 7b 0a 2b 0a 2b 09 2f 2a 20 62 61 73 69 63 20 6d s.SSLSocketToMe.{.+.+./*.basic.m
15a0 65 6d 62 65 72 20 64 61 74 61 3a 20 2a 2f 0a 2b 09 53 74 72 69 6e 67 20 68 6f 73 74 3b 0a 2b 09 ember.data:.*/.+.String.host;.+.
15c0 69 6e 74 20 70 6f 72 74 3b 0a 2b 09 56 6e 63 56 69 65 77 65 72 20 76 69 65 77 65 72 3b 0a 2b 09 int.port;.+.VncViewer.viewer;.+.
15e0 62 6f 6f 6c 65 61 6e 20 64 65 62 75 67 20 3d 20 74 72 75 65 3b 0a 2b 0a 2b 09 2f 2a 20 73 6f 63 boolean.debug.=.true;.+.+./*.soc
1600 6b 65 74 73 20 2a 2f 0a 2b 09 53 53 4c 53 6f 63 6b 65 74 20 73 6f 63 6b 65 74 20 3d 20 6e 75 6c kets.*/.+.SSLSocket.socket.=.nul
1620 6c 3b 0a 2b 09 53 53 4c 53 6f 63 6b 65 74 46 61 63 74 6f 72 79 20 66 61 63 74 6f 72 79 3b 0a 2b l;.+.SSLSocketFactory.factory;.+
1640 0a 2b 09 2f 2a 20 66 61 6c 6c 62 61 63 6b 20 66 6f 72 20 50 72 6f 78 79 20 63 6f 6e 6e 65 63 74 .+./*.fallback.for.Proxy.connect
1660 69 6f 6e 20 2a 2f 0a 2b 09 62 6f 6f 6c 65 61 6e 20 70 72 6f 78 79 5f 69 6e 5f 75 73 65 20 3d 20 ion.*/.+.boolean.proxy_in_use.=.
1680 66 61 6c 73 65 3b 0a 2b 09 62 6f 6f 6c 65 61 6e 20 70 72 6f 78 79 5f 69 73 5f 68 74 74 70 73 20 false;.+.boolean.proxy_is_https.
16a0 3d 20 66 61 6c 73 65 3b 0a 2b 09 62 6f 6f 6c 65 61 6e 20 70 72 6f 78 79 5f 66 61 69 6c 75 72 65 =.false;.+.boolean.proxy_failure
16c0 20 3d 20 66 61 6c 73 65 3b 0a 2b 09 70 75 62 6c 69 63 20 44 61 74 61 49 6e 70 75 74 53 74 72 65 .=.false;.+.public.DataInputStre
16e0 61 6d 20 69 73 20 3d 20 6e 75 6c 6c 3b 0a 2b 09 70 75 62 6c 69 63 20 4f 75 74 70 75 74 53 74 72 am.is.=.null;.+.public.OutputStr
1700 65 61 6d 20 6f 73 20 3d 20 6e 75 6c 6c 3b 0a 2b 0a 2b 09 53 74 72 69 6e 67 20 70 72 6f 78 79 5f eam.os.=.null;.+.+.String.proxy_
1720 64 69 61 6c 6f 67 5f 68 6f 73 74 20 3d 20 6e 75 6c 6c 3b 0a 2b 09 69 6e 74 20 70 72 6f 78 79 5f dialog_host.=.null;.+.int.proxy_
1740 64 69 61 6c 6f 67 5f 70 6f 72 74 20 3d 20 30 3b 0a 2b 0a 2b 09 53 6f 63 6b 65 74 20 70 72 6f 78 dialog_port.=.0;.+.+.Socket.prox
1760 79 53 6f 63 6b 3b 0a 2b 09 44 61 74 61 49 6e 70 75 74 53 74 72 65 61 6d 20 70 72 6f 78 79 5f 69 ySock;.+.DataInputStream.proxy_i
1780 73 3b 0a 2b 09 4f 75 74 70 75 74 53 74 72 65 61 6d 20 70 72 6f 78 79 5f 6f 73 3b 0a 2b 0a 2b 09 s;.+.OutputStream.proxy_os;.+.+.
17a0 2f 2a 20 74 72 75 73 74 20 63 6f 6e 74 65 78 74 73 20 2a 2f 0a 2b 09 53 53 4c 43 6f 6e 74 65 78 /*.trust.contexts.*/.+.SSLContex
17c0 74 20 74 72 75 73 74 6c 6f 63 5f 63 74 78 3b 0a 2b 09 53 53 4c 43 6f 6e 74 65 78 74 20 74 72 75 t.trustloc_ctx;.+.SSLContext.tru
17e0 73 74 61 6c 6c 5f 63 74 78 3b 0a 2b 09 53 53 4c 43 6f 6e 74 65 78 74 20 74 72 75 73 74 75 72 6c stall_ctx;.+.SSLContext.trusturl
1800 5f 63 74 78 3b 0a 2b 09 53 53 4c 43 6f 6e 74 65 78 74 20 74 72 75 73 74 6f 6e 65 5f 63 74 78 3b _ctx;.+.SSLContext.trustone_ctx;
1820 0a 2b 0a 2b 09 54 72 75 73 74 4d 61 6e 61 67 65 72 5b 5d 20 74 72 75 73 74 41 6c 6c 43 65 72 74 .+.+.TrustManager[].trustAllCert
1840 73 3b 0a 2b 09 54 72 75 73 74 4d 61 6e 61 67 65 72 5b 5d 20 74 72 75 73 74 55 72 6c 43 65 72 74 s;.+.TrustManager[].trustUrlCert
1860 3b 0a 2b 09 54 72 75 73 74 4d 61 6e 61 67 65 72 5b 5d 20 74 72 75 73 74 4f 6e 65 43 65 72 74 3b ;.+.TrustManager[].trustOneCert;
1880 0a 2b 0a 2b 09 62 6f 6f 6c 65 61 6e 20 75 73 65 5f 75 72 6c 5f 63 65 72 74 5f 66 6f 72 5f 61 75 .+.+.boolean.use_url_cert_for_au
18a0 74 68 20 3d 20 74 72 75 65 3b 0a 2b 09 62 6f 6f 6c 65 61 6e 20 75 73 65 72 5f 77 61 6e 74 73 5f th.=.true;.+.boolean.user_wants_
18c0 74 6f 5f 73 65 65 5f 63 65 72 74 20 3d 20 74 72 75 65 3b 0a 2b 0a 2b 09 2f 2a 20 63 65 72 74 28 to_see_cert.=.true;.+.+./*.cert(
18e0 73 29 20 77 65 20 72 65 74 72 69 65 76 65 20 66 72 6f 6d 20 56 4e 43 20 73 65 72 76 65 72 20 2a s).we.retrieve.from.VNC.server.*
1900 2f 0a 2b 09 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 43 65 72 74 69 66 69 63 61 /.+.java.security.cert.Certifica
1920 74 65 5b 5d 20 74 72 75 73 74 61 6c 6c 43 65 72 74 73 20 3d 20 6e 75 6c 6c 3b 0a 2b 09 6a 61 76 te[].trustallCerts.=.null;.+.jav
1940 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 43 65 72 74 69 66 69 63 61 74 65 5b 5d 20 74 72 a.security.cert.Certificate[].tr
1960 75 73 74 75 72 6c 43 65 72 74 73 20 3d 20 6e 75 6c 6c 3b 0a 2b 0a 2b 09 62 79 74 65 5b 5d 20 68 usturlCerts.=.null;.+.+.byte[].h
1980 65 78 32 62 79 74 65 73 28 53 74 72 69 6e 67 20 73 29 20 7b 0a 2b 09 09 62 79 74 65 5b 5d 20 62 ex2bytes(String.s).{.+..byte[].b
19a0 79 74 65 73 20 3d 20 6e 65 77 20 62 79 74 65 5b 73 2e 6c 65 6e 67 74 68 28 29 2f 32 5d 3b 0a 2b ytes.=.new.byte[s.length()/2];.+
19c0 09 09 66 6f 72 20 28 69 6e 74 20 69 3d 30 3b 20 69 3c 73 2e 6c 65 6e 67 74 68 28 29 2f 32 3b 20 ..for.(int.i=0;.i<s.length()/2;.
19e0 69 2b 2b 29 20 7b 0a 2b 09 09 09 69 6e 74 20 6a 20 3d 20 32 2a 69 3b 0a 2b 09 09 09 74 72 79 20 i++).{.+...int.j.=.2*i;.+...try.
1a00 7b 0a 2b 09 09 09 09 69 6e 74 20 76 61 6c 20 3d 20 49 6e 74 65 67 65 72 2e 70 61 72 73 65 49 6e {.+....int.val.=.Integer.parseIn
1a20 74 28 73 2e 73 75 62 73 74 72 69 6e 67 28 6a 2c 20 6a 2b 32 29 2c 20 31 36 29 3b 0a 2b 09 09 09 t(s.substring(j,.j+2),.16);.+...
1a40 09 69 66 20 28 76 61 6c 20 3e 20 31 32 37 29 20 7b 0a 2b 09 09 09 09 09 76 61 6c 20 2d 3d 20 32 .if.(val.>.127).{.+.....val.-=.2
1a60 35 36 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 49 6e 74 65 67 65 72 20 49 20 3d 20 6e 65 77 20 56;.+....}.+....Integer.I.=.new.
1a80 49 6e 74 65 67 65 72 28 76 61 6c 29 3b 0a 2b 09 09 09 09 62 79 74 65 73 5b 69 5d 20 3d 20 42 79 Integer(val);.+....bytes[i].=.By
1aa0 74 65 2e 64 65 63 6f 64 65 28 49 2e 74 6f 53 74 72 69 6e 67 28 29 29 2e 62 79 74 65 56 61 6c 75 te.decode(I.toString()).byteValu
1ac0 65 28 29 3b 0a 2b 09 09 09 09 0a 2b 09 09 09 7d 20 63 61 74 63 68 20 28 45 78 63 65 70 74 69 6f e();.+.....+...}.catch.(Exceptio
1ae0 6e 20 65 29 20 7b 0a 2b 09 09 09 09 3b 0a 2b 09 09 09 7d 0a 2b 09 09 7d 0a 2b 09 09 72 65 74 75 n.e).{.+....;.+...}.+..}.+..retu
1b00 72 6e 20 62 79 74 65 73 3b 0a 2b 09 7d 0a 2b 0a 2b 09 53 53 4c 53 6f 63 6b 65 74 54 6f 4d 65 28 rn.bytes;.+.}.+.+.SSLSocketToMe(
1b20 53 74 72 69 6e 67 20 68 2c 20 69 6e 74 20 70 2c 20 56 6e 63 56 69 65 77 65 72 20 76 29 20 74 68 String.h,.int.p,.VncViewer.v).th
1b40 72 6f 77 73 20 45 78 63 65 70 74 69 6f 6e 20 7b 0a 2b 09 09 68 6f 73 74 20 3d 20 68 3b 0a 2b 09 rows.Exception.{.+..host.=.h;.+.
1b60 09 70 6f 72 74 20 3d 20 70 3b 0a 2b 09 09 76 69 65 77 65 72 20 3d 20 76 3b 0a 2b 0a 2b 09 09 2f .port.=.p;.+..viewer.=.v;.+.+../
1b80 2a 20 77 65 20 77 69 6c 6c 20 66 69 72 73 74 20 74 72 79 20 64 65 66 61 75 6c 74 20 66 61 63 74 *.we.will.first.try.default.fact
1ba0 6f 72 79 20 66 6f 72 20 63 65 72 74 69 66 69 63 61 74 69 6f 6e 3a 20 2a 2f 0a 2b 0a 2b 09 09 66 ory.for.certification:.*/.+.+..f
1bc0 61 63 74 6f 72 79 20 3d 20 28 53 53 4c 53 6f 63 6b 65 74 46 61 63 74 6f 72 79 29 20 53 53 4c 53 actory.=.(SSLSocketFactory).SSLS
1be0 6f 63 6b 65 74 46 61 63 74 6f 72 79 2e 67 65 74 44 65 66 61 75 6c 74 28 29 3b 0a 2b 0a 2b 09 09 ocketFactory.getDefault();.+.+..
1c00 64 62 67 28 22 53 53 4c 20 73 74 61 72 74 75 70 3a 20 22 20 2b 20 68 6f 73 74 20 2b 20 22 20 22 dbg("SSL.startup:.".+.host.+."."
1c20 20 2b 20 70 6f 72 74 29 3b 0a 2b 0a 2b 09 09 2f 2a 20 63 72 65 61 74 65 20 74 72 75 73 74 20 6d .+.port);.+.+../*.create.trust.m
1c40 61 6e 61 67 65 72 73 20 75 73 65 64 20 69 66 20 69 6e 69 74 69 61 6c 20 68 61 6e 64 73 68 61 6b anagers.used.if.initial.handshak
1c60 65 20 66 61 69 6c 73 3a 20 2a 2f 0a 2b 0a 2b 09 09 74 72 75 73 74 41 6c 6c 43 65 72 74 73 20 3d e.fails:.*/.+.+..trustAllCerts.=
1c80 20 6e 65 77 20 54 72 75 73 74 4d 61 6e 61 67 65 72 5b 5d 20 7b 0a 2b 09 09 20 20 20 20 2f 2a 0a .new.TrustManager[].{.+....../*.
1ca0 2b 09 09 20 20 20 20 20 2a 20 74 68 69 73 20 6f 6e 65 20 61 63 63 65 70 74 73 20 65 76 65 72 79 +.......*.this.one.accepts.every
1cc0 74 68 69 6e 67 2e 0a 2b 09 09 20 20 20 20 20 2a 2f 0a 2b 09 09 20 20 20 20 6e 65 77 20 58 35 30 thing..+.......*/.+......new.X50
1ce0 39 54 72 75 73 74 4d 61 6e 61 67 65 72 28 29 20 7b 0a 2b 09 09 09 70 75 62 6c 69 63 20 6a 61 76 9TrustManager().{.+...public.jav
1d00 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 58 35 30 39 43 65 72 74 69 66 69 63 61 74 65 5b a.security.cert.X509Certificate[
1d20 5d 0a 2b 09 09 09 20 20 20 20 67 65 74 41 63 63 65 70 74 65 64 49 73 73 75 65 72 73 28 29 20 7b ].+.......getAcceptedIssuers().{
1d40 0a 2b 09 09 09 09 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 2b 09 09 09 7d 0a 2b 09 09 09 70 75 62 .+....return.null;.+...}.+...pub
1d60 6c 69 63 20 76 6f 69 64 20 63 68 65 63 6b 43 6c 69 65 6e 74 54 72 75 73 74 65 64 28 0a 2b 09 09 lic.void.checkClientTrusted(.+..
1d80 09 20 20 20 20 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 58 35 30 39 43 65 72 74 .....java.security.cert.X509Cert
1da0 69 66 69 63 61 74 65 5b 5d 20 63 65 72 74 73 2c 0a 2b 09 09 09 20 20 20 20 53 74 72 69 6e 67 20 ificate[].certs,.+.......String.
1dc0 61 75 74 68 54 79 70 65 29 20 7b 0a 2b 09 09 09 09 2f 2a 20 65 6d 70 74 79 20 2a 2f 0a 2b 09 09 authType).{.+..../*.empty.*/.+..
1de0 09 7d 0a 2b 09 09 09 70 75 62 6c 69 63 20 76 6f 69 64 20 63 68 65 63 6b 53 65 72 76 65 72 54 72 .}.+...public.void.checkServerTr
1e00 75 73 74 65 64 28 0a 2b 09 09 09 20 20 20 20 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 usted(.+.......java.security.cer
1e20 74 2e 58 35 30 39 43 65 72 74 69 66 69 63 61 74 65 5b 5d 20 63 65 72 74 73 2c 0a 2b 09 09 09 20 t.X509Certificate[].certs,.+....
1e40 20 20 20 53 74 72 69 6e 67 20 61 75 74 68 54 79 70 65 29 20 7b 0a 2b 09 09 09 09 2f 2a 20 65 6d ...String.authType).{.+..../*.em
1e60 70 74 79 20 2a 2f 0a 2b 09 09 09 09 64 62 67 28 22 41 4c 4c 3a 20 61 6e 20 75 6e 74 72 75 73 74 pty.*/.+....dbg("ALL:.an.untrust
1e80 65 64 20 63 6f 6e 6e 65 63 74 20 74 6f 20 67 72 61 62 20 63 65 72 74 2e 22 29 3b 0a 2b 09 09 09 ed.connect.to.grab.cert.");.+...
1ea0 7d 0a 2b 09 09 20 20 20 20 7d 0a 2b 09 09 7d 3b 0a 2b 0a 2b 09 09 74 72 75 73 74 55 72 6c 43 65 }.+......}.+..};.+.+..trustUrlCe
1ec0 72 74 20 3d 20 6e 65 77 20 54 72 75 73 74 4d 61 6e 61 67 65 72 5b 5d 20 7b 0a 2b 09 09 20 20 20 rt.=.new.TrustManager[].{.+.....
1ee0 20 2f 2a 0a 2b 09 09 20 20 20 20 20 2a 20 74 68 69 73 20 6f 6e 65 20 61 63 63 65 70 74 73 20 6f ./*.+.......*.this.one.accepts.o
1f00 6e 6c 79 20 74 68 65 20 72 65 74 72 69 65 76 65 64 20 73 65 72 76 65 72 20 63 65 72 74 0a 2b 09 nly.the.retrieved.server.cert.+.
1f20 09 20 20 20 20 20 2a 20 62 79 20 53 53 4c 53 6f 63 6b 65 74 20 62 79 20 74 68 69 73 20 61 70 70 ......*.by.SSLSocket.by.this.app
1f40 6c 65 74 2e 0a 2b 09 09 20 20 20 20 20 2a 2f 0a 2b 09 09 20 20 20 20 6e 65 77 20 58 35 30 39 54 let..+.......*/.+......new.X509T
1f60 72 75 73 74 4d 61 6e 61 67 65 72 28 29 20 7b 0a 2b 09 09 09 70 75 62 6c 69 63 20 6a 61 76 61 2e rustManager().{.+...public.java.
1f80 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 58 35 30 39 43 65 72 74 69 66 69 63 61 74 65 5b 5d 0a security.cert.X509Certificate[].
1fa0 2b 09 09 09 20 20 20 20 67 65 74 41 63 63 65 70 74 65 64 49 73 73 75 65 72 73 28 29 20 7b 0a 2b +.......getAcceptedIssuers().{.+
1fc0 09 09 09 09 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 2b 09 09 09 7d 0a 2b 09 09 09 70 75 62 6c 69 ....return.null;.+...}.+...publi
1fe0 63 20 76 6f 69 64 20 63 68 65 63 6b 43 6c 69 65 6e 74 54 72 75 73 74 65 64 28 0a 2b 09 09 09 20 c.void.checkClientTrusted(.+....
2000 20 20 20 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 58 35 30 39 43 65 72 74 69 66 ...java.security.cert.X509Certif
2020 69 63 61 74 65 5b 5d 20 63 65 72 74 73 2c 0a 2b 09 09 09 20 20 20 20 53 74 72 69 6e 67 20 61 75 icate[].certs,.+.......String.au
2040 74 68 54 79 70 65 29 20 74 68 72 6f 77 73 20 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 74 thType).throws.CertificateExcept
2060 69 6f 6e 20 7b 0a 2b 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 43 65 72 74 69 66 69 63 61 74 65 ion.{.+....throw.new.Certificate
2080 45 78 63 65 70 74 69 6f 6e 28 22 4e 6f 20 43 6c 69 65 6e 74 73 22 29 3b 0a 2b 09 09 09 7d 0a 2b Exception("No.Clients");.+...}.+
20a0 09 09 09 70 75 62 6c 69 63 20 76 6f 69 64 20 63 68 65 63 6b 53 65 72 76 65 72 54 72 75 73 74 65 ...public.void.checkServerTruste
20c0 64 28 0a 2b 09 09 09 20 20 20 20 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 58 35 d(.+.......java.security.cert.X5
20e0 30 39 43 65 72 74 69 66 69 63 61 74 65 5b 5d 20 63 65 72 74 73 2c 0a 2b 09 09 09 20 20 20 20 53 09Certificate[].certs,.+.......S
2100 74 72 69 6e 67 20 61 75 74 68 54 79 70 65 29 20 74 68 72 6f 77 73 20 43 65 72 74 69 66 69 63 61 tring.authType).throws.Certifica
2120 74 65 45 78 63 65 70 74 69 6f 6e 20 7b 0a 2b 09 09 09 09 69 66 20 28 74 72 75 73 74 75 72 6c 43 teException.{.+....if.(trusturlC
2140 65 72 74 73 20 3d 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 erts.==.null).{.+.....throw.new.
2160 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 74 69 6f 6e 28 0a 2b 09 09 09 09 09 20 20 20 20 CertificateException(.+.........
2180 22 4e 6f 20 54 72 75 73 74 20 75 72 6c 20 43 65 72 74 73 20 61 72 72 61 79 2e 22 29 3b 0a 2b 09 "No.Trust.url.Certs.array.");.+.
21a0 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 28 74 72 75 73 74 75 72 6c 43 65 72 74 73 2e 6c 65 6e 67 ...}.+....if.(trusturlCerts.leng
21c0 74 68 20 3c 20 31 29 20 7b 0a 2b 09 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 43 65 72 74 69 66 th.<.1).{.+.....throw.new.Certif
21e0 69 63 61 74 65 45 78 63 65 70 74 69 6f 6e 28 0a 2b 09 09 09 09 09 20 20 20 20 22 4e 6f 20 54 72 icateException(.+........."No.Tr
2200 75 73 74 20 75 72 6c 20 43 65 72 74 73 2e 22 29 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 ust.url.Certs.");.+....}.+....if
2220 20 28 74 72 75 73 74 75 72 6c 43 65 72 74 73 2e 6c 65 6e 67 74 68 20 3e 20 31 29 20 7b 0a 2b 09 .(trusturlCerts.length.>.1).{.+.
2240 09 09 09 09 69 6e 74 20 69 3b 0a 2b 09 09 09 09 09 62 6f 6f 6c 65 61 6e 20 6f 6b 20 3d 20 74 72 ....int.i;.+.....boolean.ok.=.tr
2260 75 65 3b 0a 2b 09 09 09 09 09 66 6f 72 20 28 69 20 3d 20 30 3b 20 69 20 3c 20 74 72 75 73 74 75 ue;.+.....for.(i.=.0;.i.<.trustu
2280 72 6c 43 65 72 74 73 2e 6c 65 6e 67 74 68 20 2d 20 31 3b 20 69 2b 2b 29 20 20 7b 0a 2b 09 09 09 rlCerts.length.-.1;.i++)..{.+...
22a0 09 09 09 69 66 20 28 21 20 74 72 75 73 74 75 72 6c 43 65 72 74 73 5b 69 5d 2e 65 71 75 61 6c 73 ...if.(!.trusturlCerts[i].equals
22c0 28 74 72 75 73 74 75 72 6c 43 65 72 74 73 5b 69 2b 31 5d 29 29 20 7b 0a 2b 09 09 09 09 09 09 09 (trusturlCerts[i+1])).{.+.......
22e0 6f 6b 20 3d 20 66 61 6c 73 65 3b 0a 2b 09 09 09 09 09 09 7d 0a 2b 09 09 09 09 09 7d 0a 2b 09 09 ok.=.false;.+......}.+.....}.+..
2300 09 09 09 69 66 20 28 21 20 6f 6b 29 20 7b 0a 2b 09 09 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 ...if.(!.ok).{.+......throw.new.
2320 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 74 69 6f 6e 28 0a 2b 09 09 09 09 09 09 20 20 20 CertificateException(.+.........
2340 20 22 54 6f 6f 20 6d 61 6e 79 20 54 72 75 73 74 20 75 72 6c 20 43 65 72 74 73 3a 20 22 0a 2b 09 ."Too.many.Trust.url.Certs:.".+.
2360 09 09 09 09 09 20 20 20 20 2b 20 74 72 75 73 74 75 72 6c 43 65 72 74 73 2e 6c 65 6e 67 74 68 0a .........+.trusturlCerts.length.
2380 2b 09 09 09 09 09 09 29 3b 0a 2b 09 09 09 09 09 7d 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 +......);.+.....}.+....}.+....if
23a0 20 28 63 65 72 74 73 20 3d 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 09 09 74 68 72 6f 77 20 6e .(certs.==.null).{.+.....throw.n
23c0 65 77 20 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 74 69 6f 6e 28 0a 2b 09 09 09 09 09 20 ew.CertificateException(.+......
23e0 20 20 20 22 4e 6f 20 74 68 69 73 2d 63 65 72 74 73 20 61 72 72 61 79 2e 22 29 3b 0a 2b 09 09 09 ..."No.this-certs.array.");.+...
2400 09 7d 0a 2b 09 09 09 09 69 66 20 28 63 65 72 74 73 2e 6c 65 6e 67 74 68 20 3c 20 31 29 20 7b 0a .}.+....if.(certs.length.<.1).{.
2420 2b 09 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 +.....throw.new.CertificateExcep
2440 74 69 6f 6e 28 0a 2b 09 09 09 09 09 20 20 20 20 22 4e 6f 20 74 68 69 73 2d 63 65 72 74 73 20 43 tion(.+........."No.this-certs.C
2460 65 72 74 73 2e 22 29 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 28 63 65 72 74 73 2e 6c erts.");.+....}.+....if.(certs.l
2480 65 6e 67 74 68 20 3e 20 31 29 20 7b 0a 2b 09 09 09 09 09 69 6e 74 20 69 3b 0a 2b 09 09 09 09 09 ength.>.1).{.+.....int.i;.+.....
24a0 62 6f 6f 6c 65 61 6e 20 6f 6b 20 3d 20 74 72 75 65 3b 0a 2b 09 09 09 09 09 66 6f 72 20 28 69 20 boolean.ok.=.true;.+.....for.(i.
24c0 3d 20 30 3b 20 69 20 3c 20 63 65 72 74 73 2e 6c 65 6e 67 74 68 20 2d 20 31 3b 20 69 2b 2b 29 20 =.0;.i.<.certs.length.-.1;.i++).
24e0 20 7b 0a 2b 09 09 09 09 09 09 69 66 20 28 21 20 63 65 72 74 73 5b 69 5d 2e 65 71 75 61 6c 73 28 .{.+......if.(!.certs[i].equals(
2500 63 65 72 74 73 5b 69 2b 31 5d 29 29 20 7b 0a 2b 09 09 09 09 09 09 09 6f 6b 20 3d 20 66 61 6c 73 certs[i+1])).{.+.......ok.=.fals
2520 65 3b 0a 2b 09 09 09 09 09 09 7d 0a 2b 09 09 09 09 09 7d 0a 2b 09 09 09 09 09 69 66 20 28 21 20 e;.+......}.+.....}.+.....if.(!.
2540 6f 6b 29 20 7b 0a 2b 09 09 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 43 65 72 74 69 66 69 63 61 ok).{.+......throw.new.Certifica
2560 74 65 45 78 63 65 70 74 69 6f 6e 28 0a 2b 09 09 09 09 09 09 20 20 20 20 22 54 6f 6f 20 6d 61 6e teException(.+.........."Too.man
2580 79 20 74 68 69 73 2d 63 65 72 74 73 3a 20 22 0a 2b 09 09 09 09 09 09 20 20 20 20 2b 20 63 65 72 y.this-certs:.".+..........+.cer
25a0 74 73 2e 6c 65 6e 67 74 68 0a 2b 09 09 09 09 09 09 29 3b 0a 2b 09 09 09 09 09 7d 0a 2b 09 09 09 ts.length.+......);.+.....}.+...
25c0 09 7d 0a 2b 09 09 09 09 69 66 20 28 21 20 74 72 75 73 74 75 72 6c 43 65 72 74 73 5b 30 5d 2e 65 .}.+....if.(!.trusturlCerts[0].e
25e0 71 75 61 6c 73 28 63 65 72 74 73 5b 30 5d 29 29 20 7b 0a 2b 09 09 09 09 09 74 68 72 6f 77 20 6e quals(certs[0])).{.+.....throw.n
2600 65 77 20 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 74 69 6f 6e 28 0a 2b 09 09 09 09 09 20 ew.CertificateException(.+......
2620 20 20 20 22 53 65 72 76 65 72 20 43 65 72 74 20 43 68 61 6e 67 65 64 20 21 3d 20 55 52 4c 2e 22 ..."Server.Cert.Changed.!=.URL."
2640 29 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 64 62 67 28 22 55 52 4c 3a 20 74 72 75 73 74 75 72 );.+....}.+....dbg("URL:.trustur
2660 6c 43 65 72 74 73 5b 30 5d 20 6d 61 74 63 68 65 73 20 63 65 72 74 73 5b 30 5d 22 29 3b 0a 2b 09 lCerts[0].matches.certs[0]");.+.
2680 09 09 7d 0a 2b 09 09 20 20 20 20 7d 0a 2b 09 09 7d 3b 0a 2b 09 09 74 72 75 73 74 4f 6e 65 43 65 ..}.+......}.+..};.+..trustOneCe
26a0 72 74 20 3d 20 6e 65 77 20 54 72 75 73 74 4d 61 6e 61 67 65 72 5b 5d 20 7b 0a 2b 09 09 20 20 20 rt.=.new.TrustManager[].{.+.....
26c0 20 2f 2a 0a 2b 09 09 20 20 20 20 20 2a 20 74 68 69 73 20 6f 6e 65 20 61 63 63 65 70 74 73 20 6f ./*.+.......*.this.one.accepts.o
26e0 6e 6c 79 20 74 68 65 20 72 65 74 72 69 65 76 65 64 20 73 65 72 76 65 72 20 63 65 72 74 0a 2b 09 nly.the.retrieved.server.cert.+.
2700 09 20 20 20 20 20 2a 20 62 79 20 53 53 4c 53 6f 63 6b 65 74 20 62 79 20 74 68 69 73 20 61 70 70 ......*.by.SSLSocket.by.this.app
2720 6c 65 74 2e 0a 2b 09 09 20 20 20 20 20 2a 2f 0a 2b 09 09 20 20 20 20 6e 65 77 20 58 35 30 39 54 let..+.......*/.+......new.X509T
2740 72 75 73 74 4d 61 6e 61 67 65 72 28 29 20 7b 0a 2b 09 09 09 70 75 62 6c 69 63 20 6a 61 76 61 2e rustManager().{.+...public.java.
2760 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 58 35 30 39 43 65 72 74 69 66 69 63 61 74 65 5b 5d 0a security.cert.X509Certificate[].
2780 2b 09 09 09 20 20 20 20 67 65 74 41 63 63 65 70 74 65 64 49 73 73 75 65 72 73 28 29 20 7b 0a 2b +.......getAcceptedIssuers().{.+
27a0 09 09 09 09 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 2b 09 09 09 7d 0a 2b 09 09 09 70 75 62 6c 69 ....return.null;.+...}.+...publi
27c0 63 20 76 6f 69 64 20 63 68 65 63 6b 43 6c 69 65 6e 74 54 72 75 73 74 65 64 28 0a 2b 09 09 09 20 c.void.checkClientTrusted(.+....
27e0 20 20 20 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 58 35 30 39 43 65 72 74 69 66 ...java.security.cert.X509Certif
2800 69 63 61 74 65 5b 5d 20 63 65 72 74 73 2c 0a 2b 09 09 09 20 20 20 20 53 74 72 69 6e 67 20 61 75 icate[].certs,.+.......String.au
2820 74 68 54 79 70 65 29 20 74 68 72 6f 77 73 20 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 74 thType).throws.CertificateExcept
2840 69 6f 6e 20 7b 0a 2b 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 43 65 72 74 69 66 69 63 61 74 65 ion.{.+....throw.new.Certificate
2860 45 78 63 65 70 74 69 6f 6e 28 22 4e 6f 20 43 6c 69 65 6e 74 73 22 29 3b 0a 2b 09 09 09 7d 0a 2b Exception("No.Clients");.+...}.+
2880 09 09 09 70 75 62 6c 69 63 20 76 6f 69 64 20 63 68 65 63 6b 53 65 72 76 65 72 54 72 75 73 74 65 ...public.void.checkServerTruste
28a0 64 28 0a 2b 09 09 09 20 20 20 20 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 58 35 d(.+.......java.security.cert.X5
28c0 30 39 43 65 72 74 69 66 69 63 61 74 65 5b 5d 20 63 65 72 74 73 2c 0a 2b 09 09 09 20 20 20 20 53 09Certificate[].certs,.+.......S
28e0 74 72 69 6e 67 20 61 75 74 68 54 79 70 65 29 20 74 68 72 6f 77 73 20 43 65 72 74 69 66 69 63 61 tring.authType).throws.Certifica
2900 74 65 45 78 63 65 70 74 69 6f 6e 20 7b 0a 2b 09 09 09 09 69 66 20 28 74 72 75 73 74 61 6c 6c 43 teException.{.+....if.(trustallC
2920 65 72 74 73 20 3d 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 erts.==.null).{.+.....throw.new.
2940 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 74 69 6f 6e 28 0a 2b 09 09 09 09 09 20 20 20 20 CertificateException(.+.........
2960 22 4e 6f 20 54 72 75 73 74 20 41 6c 6c 20 53 65 72 76 65 72 20 43 65 72 74 73 20 61 72 72 61 79 "No.Trust.All.Server.Certs.array
2980 2e 22 29 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 28 74 72 75 73 74 61 6c 6c 43 65 72 .");.+....}.+....if.(trustallCer
29a0 74 73 2e 6c 65 6e 67 74 68 20 3c 20 31 29 20 7b 0a 2b 09 09 09 09 09 74 68 72 6f 77 20 6e 65 77 ts.length.<.1).{.+.....throw.new
29c0 20 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 74 69 6f 6e 28 0a 2b 09 09 09 09 09 20 20 20 .CertificateException(.+........
29e0 20 22 4e 6f 20 54 72 75 73 74 20 41 6c 6c 20 53 65 72 76 65 72 20 43 65 72 74 73 2e 22 29 3b 0a ."No.Trust.All.Server.Certs.");.
2a00 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 28 74 72 75 73 74 61 6c 6c 43 65 72 74 73 2e 6c 65 +....}.+....if.(trustallCerts.le
2a20 6e 67 74 68 20 3e 20 31 29 20 7b 0a 2b 09 09 09 09 09 69 6e 74 20 69 3b 0a 2b 09 09 09 09 09 62 ngth.>.1).{.+.....int.i;.+.....b
2a40 6f 6f 6c 65 61 6e 20 6f 6b 20 3d 20 74 72 75 65 3b 0a 2b 09 09 09 09 09 66 6f 72 20 28 69 20 3d oolean.ok.=.true;.+.....for.(i.=
2a60 20 30 3b 20 69 20 3c 20 74 72 75 73 74 61 6c 6c 43 65 72 74 73 2e 6c 65 6e 67 74 68 20 2d 20 31 .0;.i.<.trustallCerts.length.-.1
2a80 3b 20 69 2b 2b 29 20 20 7b 0a 2b 09 09 09 09 09 09 69 66 20 28 21 20 74 72 75 73 74 61 6c 6c 43 ;.i++)..{.+......if.(!.trustallC
2aa0 65 72 74 73 5b 69 5d 2e 65 71 75 61 6c 73 28 74 72 75 73 74 61 6c 6c 43 65 72 74 73 5b 69 2b 31 erts[i].equals(trustallCerts[i+1
2ac0 5d 29 29 20 7b 0a 2b 09 09 09 09 09 09 09 6f 6b 20 3d 20 66 61 6c 73 65 3b 0a 2b 09 09 09 09 09 ])).{.+.......ok.=.false;.+.....
2ae0 09 7d 0a 2b 09 09 09 09 09 7d 0a 2b 09 09 09 09 09 69 66 20 28 21 20 6f 6b 29 20 7b 0a 2b 09 09 .}.+.....}.+.....if.(!.ok).{.+..
2b00 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 74 69 ....throw.new.CertificateExcepti
2b20 6f 6e 28 0a 2b 09 09 09 09 09 09 20 20 20 20 22 54 6f 6f 20 6d 61 6e 79 20 54 72 75 73 74 20 41 on(.+.........."Too.many.Trust.A
2b40 6c 6c 20 53 65 72 76 65 72 20 43 65 72 74 73 3a 20 22 0a 2b 09 09 09 09 09 09 20 20 20 20 2b 20 ll.Server.Certs:.".+..........+.
2b60 74 72 75 73 74 61 6c 6c 43 65 72 74 73 2e 6c 65 6e 67 74 68 0a 2b 09 09 09 09 09 09 29 3b 0a 2b trustallCerts.length.+......);.+
2b80 09 09 09 09 09 7d 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 28 63 65 72 74 73 20 3d 3d 20 .....}.+....}.+....if.(certs.==.
2ba0 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 43 65 72 74 69 66 69 63 null).{.+.....throw.new.Certific
2bc0 61 74 65 45 78 63 65 70 74 69 6f 6e 28 0a 2b 09 09 09 09 09 20 20 20 20 22 4e 6f 20 74 68 69 73 ateException(.+........."No.this
2be0 2d 63 65 72 74 73 20 61 72 72 61 79 2e 22 29 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 -certs.array.");.+....}.+....if.
2c00 28 63 65 72 74 73 2e 6c 65 6e 67 74 68 20 3c 20 31 29 20 7b 0a 2b 09 09 09 09 09 74 68 72 6f 77 (certs.length.<.1).{.+.....throw
2c20 20 6e 65 77 20 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 74 69 6f 6e 28 0a 2b 09 09 09 09 .new.CertificateException(.+....
2c40 09 20 20 20 20 22 4e 6f 20 74 68 69 73 2d 63 65 72 74 73 20 43 65 72 74 73 2e 22 29 3b 0a 2b 09 ....."No.this-certs.Certs.");.+.
2c60 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 28 63 65 72 74 73 2e 6c 65 6e 67 74 68 20 3e 20 31 29 20 ...}.+....if.(certs.length.>.1).
2c80 7b 0a 2b 09 09 09 09 09 69 6e 74 20 69 3b 0a 2b 09 09 09 09 09 62 6f 6f 6c 65 61 6e 20 6f 6b 20 {.+.....int.i;.+.....boolean.ok.
2ca0 3d 20 74 72 75 65 3b 0a 2b 09 09 09 09 09 66 6f 72 20 28 69 20 3d 20 30 3b 20 69 20 3c 20 63 65 =.true;.+.....for.(i.=.0;.i.<.ce
2cc0 72 74 73 2e 6c 65 6e 67 74 68 20 2d 20 31 3b 20 69 2b 2b 29 20 20 7b 0a 2b 09 09 09 09 09 09 69 rts.length.-.1;.i++)..{.+......i
2ce0 66 20 28 21 20 63 65 72 74 73 5b 69 5d 2e 65 71 75 61 6c 73 28 63 65 72 74 73 5b 69 2b 31 5d 29 f.(!.certs[i].equals(certs[i+1])
2d00 29 20 7b 0a 2b 09 09 09 09 09 09 09 6f 6b 20 3d 20 66 61 6c 73 65 3b 0a 2b 09 09 09 09 09 09 7d ).{.+.......ok.=.false;.+......}
2d20 0a 2b 09 09 09 09 09 7d 0a 2b 09 09 09 09 09 69 66 20 28 21 20 6f 6b 29 20 7b 0a 2b 09 09 09 09 .+.....}.+.....if.(!.ok).{.+....
2d40 09 09 74 68 72 6f 77 20 6e 65 77 20 43 65 72 74 69 66 69 63 61 74 65 45 78 63 65 70 74 69 6f 6e ..throw.new.CertificateException
2d60 28 0a 2b 09 09 09 09 09 09 20 20 20 20 22 54 6f 6f 20 6d 61 6e 79 20 74 68 69 73 2d 63 65 72 74 (.+.........."Too.many.this-cert
2d80 73 3a 20 22 0a 2b 09 09 09 09 09 09 20 20 20 20 2b 20 63 65 72 74 73 2e 6c 65 6e 67 74 68 0a 2b s:.".+..........+.certs.length.+
2da0 09 09 09 09 09 09 29 3b 0a 2b 09 09 09 09 09 7d 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 ......);.+.....}.+....}.+....if.
2dc0 28 21 20 74 72 75 73 74 61 6c 6c 43 65 72 74 73 5b 30 5d 2e 65 71 75 61 6c 73 28 63 65 72 74 73 (!.trustallCerts[0].equals(certs
2de0 5b 30 5d 29 29 20 7b 0a 2b 09 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 43 65 72 74 69 66 69 63 [0])).{.+.....throw.new.Certific
2e00 61 74 65 45 78 63 65 70 74 69 6f 6e 28 0a 2b 09 09 09 09 09 20 20 20 20 22 53 65 72 76 65 72 20 ateException(.+........."Server.
2e20 43 65 72 74 20 43 68 61 6e 67 65 64 20 21 3d 20 54 52 55 53 54 41 4c 4c 2e 22 29 3b 0a 2b 09 09 Cert.Changed.!=.TRUSTALL.");.+..
2e40 09 09 7d 0a 2b 09 09 09 09 64 62 67 28 22 4f 4e 45 3a 20 74 72 75 73 74 61 6c 6c 43 65 72 74 73 ..}.+....dbg("ONE:.trustallCerts
2e60 5b 30 5d 20 6d 61 74 63 68 65 73 20 63 65 72 74 73 5b 30 5d 22 29 3b 0a 2b 09 09 09 7d 0a 2b 09 [0].matches.certs[0]");.+...}.+.
2e80 09 20 20 20 20 7d 0a 2b 09 09 7d 3b 0a 2b 0a 2b 09 09 2f 2a 20 0a 2b 09 09 20 2a 20 54 68 65 79 .....}.+..};.+.+../*..+...*.They
2ea0 20 61 72 65 20 75 73 65 64 3a 0a 2b 09 09 20 2a 0a 2b 09 09 20 2a 20 31 29 20 74 6f 20 72 65 74 .are.used:.+...*.+...*.1).to.ret
2ec0 72 69 65 76 65 20 74 68 65 20 73 65 72 76 65 72 20 63 65 72 74 20 69 6e 20 63 61 73 65 20 6f 66 rieve.the.server.cert.in.case.of
2ee0 20 66 61 69 6c 75 72 65 20 74 6f 0a 2b 09 09 20 2a 20 20 20 20 64 69 73 70 6c 61 79 20 69 74 20 .failure.to.+...*....display.it.
2f00 74 6f 20 74 68 65 20 75 73 65 72 2e 0a 2b 09 09 20 2a 20 32 29 20 74 6f 20 73 75 62 73 65 71 75 to.the.user..+...*.2).to.subsequ
2f20 65 6e 74 6c 79 20 63 6f 6e 6e 65 63 74 20 74 6f 20 74 68 65 20 73 65 72 76 65 72 20 69 66 20 75 ently.connect.to.the.server.if.u
2f40 73 65 72 20 61 67 72 65 65 73 2e 0a 2b 09 09 20 2a 2f 0a 2b 0a 2b 09 09 4b 65 79 4d 61 6e 61 67 ser.agrees..+...*/.+.+..KeyManag
2f60 65 72 5b 5d 20 6d 79 6b 65 79 20 3d 20 6e 75 6c 6c 3b 0a 2b 0a 2b 09 09 69 66 20 28 76 69 65 77 er[].mykey.=.null;.+.+..if.(view
2f80 65 72 2e 6f 6e 65 54 69 6d 65 4b 65 79 20 21 3d 20 6e 75 6c 6c 20 26 26 20 76 69 65 77 65 72 2e er.oneTimeKey.!=.null.&&.viewer.
2fa0 6f 6e 65 54 69 6d 65 4b 65 79 2e 65 71 75 61 6c 73 28 22 50 52 4f 4d 50 54 22 29 29 20 7b 0a 2b oneTimeKey.equals("PROMPT")).{.+
2fc0 09 09 09 43 6c 69 65 6e 74 43 65 72 74 44 69 61 6c 6f 67 20 64 20 3d 20 6e 65 77 20 43 6c 69 65 ...ClientCertDialog.d.=.new.Clie
2fe0 6e 74 43 65 72 74 44 69 61 6c 6f 67 28 29 3b 0a 2b 09 09 09 76 69 65 77 65 72 2e 6f 6e 65 54 69 ntCertDialog();.+...viewer.oneTi
3000 6d 65 4b 65 79 20 3d 20 64 2e 71 75 65 72 79 55 73 65 72 28 29 3b 0a 2b 09 09 7d 0a 2b 0a 2b 09 meKey.=.d.queryUser();.+..}.+.+.
3020 09 69 66 20 28 76 69 65 77 65 72 2e 6f 6e 65 54 69 6d 65 4b 65 79 20 21 3d 20 6e 75 6c 6c 20 26 .if.(viewer.oneTimeKey.!=.null.&
3040 26 20 76 69 65 77 65 72 2e 6f 6e 65 54 69 6d 65 4b 65 79 2e 69 6e 64 65 78 4f 66 28 22 2c 22 29 &.viewer.oneTimeKey.indexOf(",")
3060 20 3e 20 30 29 20 7b 0a 2b 09 09 09 69 6e 74 20 69 64 78 20 3d 20 76 69 65 77 65 72 2e 6f 6e 65 .>.0).{.+...int.idx.=.viewer.one
3080 54 69 6d 65 4b 65 79 2e 69 6e 64 65 78 4f 66 28 22 2c 22 29 3b 0a 2b 0a 2b 09 09 09 53 74 72 69 TimeKey.indexOf(",");.+.+...Stri
30a0 6e 67 20 6f 6e 65 74 69 6d 65 6b 65 79 20 3d 20 76 69 65 77 65 72 2e 6f 6e 65 54 69 6d 65 4b 65 ng.onetimekey.=.viewer.oneTimeKe
30c0 79 2e 73 75 62 73 74 72 69 6e 67 28 30 2c 20 69 64 78 29 3b 0a 2b 09 09 09 62 79 74 65 5b 5d 20 y.substring(0,.idx);.+...byte[].
30e0 6b 65 79 20 3d 20 68 65 78 32 62 79 74 65 73 28 6f 6e 65 74 69 6d 65 6b 65 79 29 3b 0a 2b 09 09 key.=.hex2bytes(onetimekey);.+..
3100 09 53 74 72 69 6e 67 20 6f 6e 65 74 69 6d 65 63 65 72 74 20 3d 20 76 69 65 77 65 72 2e 6f 6e 65 .String.onetimecert.=.viewer.one
3120 54 69 6d 65 4b 65 79 2e 73 75 62 73 74 72 69 6e 67 28 69 64 78 2b 31 29 3b 0a 2b 09 09 09 62 79 TimeKey.substring(idx+1);.+...by
3140 74 65 5b 5d 20 63 65 72 74 20 3d 20 68 65 78 32 62 79 74 65 73 28 6f 6e 65 74 69 6d 65 63 65 72 te[].cert.=.hex2bytes(onetimecer
3160 74 29 3b 0a 2b 0a 2b 09 09 09 4b 65 79 46 61 63 74 6f 72 79 20 6b 66 20 3d 20 4b 65 79 46 61 63 t);.+.+...KeyFactory.kf.=.KeyFac
3180 74 6f 72 79 2e 67 65 74 49 6e 73 74 61 6e 63 65 28 22 52 53 41 22 29 3b 0a 2b 09 09 09 50 4b 43 tory.getInstance("RSA");.+...PKC
31a0 53 38 45 6e 63 6f 64 65 64 4b 65 79 53 70 65 63 20 6b 65 79 73 70 20 3d 20 6e 65 77 20 50 4b 43 S8EncodedKeySpec.keysp.=.new.PKC
31c0 53 38 45 6e 63 6f 64 65 64 4b 65 79 53 70 65 63 20 28 20 6b 65 79 20 29 3b 0a 2b 09 09 09 50 72 S8EncodedKeySpec.(.key.);.+...Pr
31e0 69 76 61 74 65 4b 65 79 20 66 66 20 3d 20 6b 66 2e 67 65 6e 65 72 61 74 65 50 72 69 76 61 74 65 ivateKey.ff.=.kf.generatePrivate
3200 20 28 6b 65 79 73 70 29 3b 0a 2b 09 09 09 2f 2f 64 62 67 28 22 66 66 20 22 20 2b 20 66 66 29 3b .(keysp);.+...//dbg("ff.".+.ff);
3220 0a 2b 09 09 09 53 74 72 69 6e 67 20 63 65 72 74 5f 73 74 72 20 3d 20 6e 65 77 20 53 74 72 69 6e .+...String.cert_str.=.new.Strin
3240 67 28 63 65 72 74 29 3b 0a 2b 0a 2b 09 09 09 43 65 72 74 69 66 69 63 61 74 65 46 61 63 74 6f 72 g(cert);.+.+...CertificateFactor
3260 79 20 63 66 20 3d 20 43 65 72 74 69 66 69 63 61 74 65 46 61 63 74 6f 72 79 2e 67 65 74 49 6e 73 y.cf.=.CertificateFactory.getIns
3280 74 61 6e 63 65 28 22 58 2e 35 30 39 22 29 3b 0a 2b 09 09 09 43 6f 6c 6c 65 63 74 69 6f 6e 20 63 tance("X.509");.+...Collection.c
32a0 20 3d 20 63 66 2e 67 65 6e 65 72 61 74 65 43 65 72 74 69 66 69 63 61 74 65 73 28 6e 65 77 20 42 .=.cf.generateCertificates(new.B
32c0 79 74 65 41 72 72 61 79 49 6e 70 75 74 53 74 72 65 61 6d 28 63 65 72 74 29 29 3b 0a 2b 09 09 09 yteArrayInputStream(cert));.+...
32e0 43 65 72 74 69 66 69 63 61 74 65 5b 5d 20 63 65 72 74 73 20 3d 20 6e 65 77 20 43 65 72 74 69 66 Certificate[].certs.=.new.Certif
3300 69 63 61 74 65 5b 63 2e 74 6f 41 72 72 61 79 28 29 2e 6c 65 6e 67 74 68 5d 3b 0a 2b 09 09 09 69 icate[c.toArray().length];.+...i
3320 66 20 28 63 2e 73 69 7a 65 28 29 20 3d 3d 20 31 29 20 7b 0a 2b 09 09 09 09 43 65 72 74 69 66 69 f.(c.size().==.1).{.+....Certifi
3340 63 61 74 65 20 74 6d 70 63 65 72 74 20 3d 20 63 66 2e 67 65 6e 65 72 61 74 65 43 65 72 74 69 66 cate.tmpcert.=.cf.generateCertif
3360 69 63 61 74 65 28 6e 65 77 20 42 79 74 65 41 72 72 61 79 49 6e 70 75 74 53 74 72 65 61 6d 28 63 icate(new.ByteArrayInputStream(c
3380 65 72 74 29 29 3b 0a 2b 09 09 09 09 2f 2f 64 62 67 28 22 74 6d 70 63 65 72 74 22 20 2b 20 74 6d ert));.+....//dbg("tmpcert".+.tm
33a0 70 63 65 72 74 29 3b 0a 2b 09 09 09 09 63 65 72 74 73 5b 30 5d 20 3d 20 74 6d 70 63 65 72 74 3b pcert);.+....certs[0].=.tmpcert;
33c0 0a 2b 09 09 09 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 09 63 65 72 74 73 20 3d 20 28 43 65 72 74 .+...}.else.{.+....certs.=.(Cert
33e0 69 66 69 63 61 74 65 5b 5d 29 20 63 2e 74 6f 41 72 72 61 79 28 29 3b 0a 2b 09 09 09 7d 0a 2b 0a ificate[]).c.toArray();.+...}.+.
3400 2b 09 09 09 4b 65 79 53 74 6f 72 65 20 6b 73 20 3d 20 4b 65 79 53 74 6f 72 65 2e 67 65 74 49 6e +...KeyStore.ks.=.KeyStore.getIn
3420 73 74 61 6e 63 65 28 22 4a 4b 53 22 29 3b 0a 2b 09 09 09 6b 73 2e 6c 6f 61 64 28 6e 75 6c 6c 2c stance("JKS");.+...ks.load(null,
3440 20 6e 75 6c 6c 29 3b 0a 2b 09 09 09 6b 73 2e 73 65 74 4b 65 79 45 6e 74 72 79 28 22 6f 6e 65 74 .null);.+...ks.setKeyEntry("onet
3460 69 6d 65 6b 65 79 22 2c 20 66 66 2c 20 22 22 2e 74 6f 43 68 61 72 41 72 72 61 79 28 29 2c 20 63 imekey",.ff,."".toCharArray(),.c
3480 65 72 74 73 29 3b 0a 2b 09 09 09 53 74 72 69 6e 67 20 64 61 20 3d 20 4b 65 79 4d 61 6e 61 67 65 erts);.+...String.da.=.KeyManage
34a0 72 46 61 63 74 6f 72 79 2e 67 65 74 44 65 66 61 75 6c 74 41 6c 67 6f 72 69 74 68 6d 28 29 3b 0a rFactory.getDefaultAlgorithm();.
34c0 2b 09 09 09 4b 65 79 4d 61 6e 61 67 65 72 46 61 63 74 6f 72 79 20 6b 6d 66 20 3d 20 4b 65 79 4d +...KeyManagerFactory.kmf.=.KeyM
34e0 61 6e 61 67 65 72 46 61 63 74 6f 72 79 2e 67 65 74 49 6e 73 74 61 6e 63 65 28 64 61 29 3b 0a 2b anagerFactory.getInstance(da);.+
3500 09 09 09 6b 6d 66 2e 69 6e 69 74 28 6b 73 2c 20 22 22 2e 74 6f 43 68 61 72 41 72 72 61 79 28 29 ...kmf.init(ks,."".toCharArray()
3520 29 3b 0a 2b 0a 2b 09 09 09 6d 79 6b 65 79 20 3d 20 6b 6d 66 2e 67 65 74 4b 65 79 4d 61 6e 61 67 );.+.+...mykey.=.kmf.getKeyManag
3540 65 72 73 28 29 3b 0a 2b 09 09 7d 0a 2b 0a 2b 0a 2b 09 09 2f 2a 20 74 72 75 73 74 20 6c 6f 63 20 ers();.+..}.+.+.+../*.trust.loc.
3560 63 65 72 74 73 3a 20 2a 2f 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 74 72 75 73 74 6c 6f 63 5f certs:.*/.+..try.{.+...trustloc_
3580 63 74 78 20 3d 20 53 53 4c 43 6f 6e 74 65 78 74 2e 67 65 74 49 6e 73 74 61 6e 63 65 28 22 53 53 ctx.=.SSLContext.getInstance("SS
35a0 4c 22 29 3b 0a 2b 09 09 09 74 72 75 73 74 6c 6f 63 5f 63 74 78 2e 69 6e 69 74 28 6d 79 6b 65 79 L");.+...trustloc_ctx.init(mykey
35c0 2c 20 6e 75 6c 6c 2c 20 6e 65 77 0a 2b 09 09 09 20 20 20 20 6a 61 76 61 2e 73 65 63 75 72 69 74 ,.null,.new.+.......java.securit
35e0 79 2e 53 65 63 75 72 65 52 61 6e 64 6f 6d 28 29 29 3b 0a 2b 0a 2b 09 09 7d 20 63 61 74 63 68 20 y.SecureRandom());.+.+..}.catch.
3600 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 53 74 72 69 6e 67 20 6d 73 67 20 3d (Exception.e).{.+...String.msg.=
3620 20 22 53 53 4c 20 74 72 75 73 74 6c 6f 63 5f 63 74 78 20 46 41 49 4c 45 44 2e 22 3b 0a 2b 09 09 ."SSL.trustloc_ctx.FAILED.";.+..
3640 09 64 62 67 28 6d 73 67 29 3b 0a 2b 09 09 09 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 .dbg(msg);.+...throw.new.Excepti
3660 6f 6e 28 6d 73 67 29 3b 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 2f 2a 20 74 72 75 73 74 20 61 6c 6c 20 on(msg);.+..}.+.+../*.trust.all.
3680 63 65 72 74 73 3a 20 2a 2f 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 74 72 75 73 74 61 6c 6c 5f certs:.*/.+..try.{.+...trustall_
36a0 63 74 78 20 3d 20 53 53 4c 43 6f 6e 74 65 78 74 2e 67 65 74 49 6e 73 74 61 6e 63 65 28 22 53 53 ctx.=.SSLContext.getInstance("SS
36c0 4c 22 29 3b 0a 2b 09 09 09 74 72 75 73 74 61 6c 6c 5f 63 74 78 2e 69 6e 69 74 28 6d 79 6b 65 79 L");.+...trustall_ctx.init(mykey
36e0 2c 20 74 72 75 73 74 41 6c 6c 43 65 72 74 73 2c 20 6e 65 77 0a 2b 09 09 09 20 20 20 20 6a 61 76 ,.trustAllCerts,.new.+.......jav
3700 61 2e 73 65 63 75 72 69 74 79 2e 53 65 63 75 72 65 52 61 6e 64 6f 6d 28 29 29 3b 0a 2b 0a 2b 09 a.security.SecureRandom());.+.+.
3720 09 7d 20 63 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 53 74 72 .}.catch.(Exception.e).{.+...Str
3740 69 6e 67 20 6d 73 67 20 3d 20 22 53 53 4c 20 74 72 75 73 74 61 6c 6c 5f 63 74 78 20 46 41 49 4c ing.msg.=."SSL.trustall_ctx.FAIL
3760 45 44 2e 22 3b 0a 2b 09 09 09 64 62 67 28 6d 73 67 29 3b 0a 2b 09 09 09 74 68 72 6f 77 20 6e 65 ED.";.+...dbg(msg);.+...throw.ne
3780 77 20 45 78 63 65 70 74 69 6f 6e 28 6d 73 67 29 3b 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 2f 2a 20 74 w.Exception(msg);.+..}.+.+../*.t
37a0 72 75 73 74 20 75 72 6c 20 63 65 72 74 73 3a 20 2a 2f 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 rust.url.certs:.*/.+..try.{.+...
37c0 74 72 75 73 74 75 72 6c 5f 63 74 78 20 3d 20 53 53 4c 43 6f 6e 74 65 78 74 2e 67 65 74 49 6e 73 trusturl_ctx.=.SSLContext.getIns
37e0 74 61 6e 63 65 28 22 53 53 4c 22 29 3b 0a 2b 09 09 09 74 72 75 73 74 75 72 6c 5f 63 74 78 2e 69 tance("SSL");.+...trusturl_ctx.i
3800 6e 69 74 28 6d 79 6b 65 79 2c 20 74 72 75 73 74 55 72 6c 43 65 72 74 2c 20 6e 65 77 0a 2b 09 09 nit(mykey,.trustUrlCert,.new.+..
3820 09 20 20 20 20 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 53 65 63 75 72 65 52 61 6e 64 6f 6d 28 .....java.security.SecureRandom(
3840 29 29 3b 0a 2b 0a 2b 09 09 7d 20 63 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b ));.+.+..}.catch.(Exception.e).{
3860 0a 2b 09 09 09 53 74 72 69 6e 67 20 6d 73 67 20 3d 20 22 53 53 4c 20 74 72 75 73 74 75 72 6c 5f .+...String.msg.=."SSL.trusturl_
3880 63 74 78 20 46 41 49 4c 45 44 2e 22 3b 0a 2b 09 09 09 64 62 67 28 6d 73 67 29 3b 0a 2b 09 09 09 ctx.FAILED.";.+...dbg(msg);.+...
38a0 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 6d 73 67 29 3b 0a 2b 09 09 7d 0a 2b throw.new.Exception(msg);.+..}.+
38c0 0a 2b 09 09 2f 2a 20 74 72 75 73 74 20 74 68 65 20 6f 6e 65 20 63 65 72 74 20 66 72 6f 6d 20 73 .+../*.trust.the.one.cert.from.s
38e0 65 72 76 65 72 3a 20 2a 2f 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 74 72 75 73 74 6f 6e 65 5f erver:.*/.+..try.{.+...trustone_
3900 63 74 78 20 3d 20 53 53 4c 43 6f 6e 74 65 78 74 2e 67 65 74 49 6e 73 74 61 6e 63 65 28 22 53 53 ctx.=.SSLContext.getInstance("SS
3920 4c 22 29 3b 0a 2b 09 09 09 74 72 75 73 74 6f 6e 65 5f 63 74 78 2e 69 6e 69 74 28 6d 79 6b 65 79 L");.+...trustone_ctx.init(mykey
3940 2c 20 74 72 75 73 74 4f 6e 65 43 65 72 74 2c 20 6e 65 77 0a 2b 09 09 09 20 20 20 20 6a 61 76 61 ,.trustOneCert,.new.+.......java
3960 2e 73 65 63 75 72 69 74 79 2e 53 65 63 75 72 65 52 61 6e 64 6f 6d 28 29 29 3b 0a 2b 0a 2b 09 09 .security.SecureRandom());.+.+..
3980 7d 20 63 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 53 74 72 69 }.catch.(Exception.e).{.+...Stri
39a0 6e 67 20 6d 73 67 20 3d 20 22 53 53 4c 20 74 72 75 73 74 6f 6e 65 5f 63 74 78 20 46 41 49 4c 45 ng.msg.=."SSL.trustone_ctx.FAILE
39c0 44 2e 22 3b 0a 2b 09 09 09 64 62 67 28 6d 73 67 29 3b 0a 2b 09 09 09 74 68 72 6f 77 20 6e 65 77 D.";.+...dbg(msg);.+...throw.new
39e0 20 45 78 63 65 70 74 69 6f 6e 28 6d 73 67 29 3b 0a 2b 09 09 7d 0a 2b 09 7d 0a 2b 0a 2b 09 62 6f .Exception(msg);.+..}.+.}.+.+.bo
3a00 6f 6c 65 61 6e 20 62 72 6f 77 73 65 72 5f 63 65 72 74 5f 6d 61 74 63 68 28 29 20 7b 0a 2b 09 09 olean.browser_cert_match().{.+..
3a20 53 74 72 69 6e 67 20 6d 73 67 20 3d 20 22 42 72 6f 77 73 65 72 20 55 52 4c 20 61 63 63 65 70 74 String.msg.=."Browser.URL.accept
3a40 20 70 72 65 76 69 6f 75 73 6c 79 20 61 63 63 65 70 74 65 64 20 63 65 72 74 22 3b 0a 2b 0a 2b 09 .previously.accepted.cert";.+.+.
3a60 09 69 66 20 28 75 73 65 72 5f 77 61 6e 74 73 5f 74 6f 5f 73 65 65 5f 63 65 72 74 29 20 7b 0a 2b .if.(user_wants_to_see_cert).{.+
3a80 09 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 69 66 20 28 74 ...return.false;.+..}.+.+..if.(t
3aa0 72 75 73 74 61 6c 6c 43 65 72 74 73 20 21 3d 20 6e 75 6c 6c 20 26 26 20 74 72 75 73 74 75 72 6c rustallCerts.!=.null.&&.trusturl
3ac0 43 65 72 74 73 20 21 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 20 20 20 20 69 66 20 28 74 72 75 73 Certs.!=.null).{.+......if.(trus
3ae0 74 61 6c 6c 43 65 72 74 73 2e 6c 65 6e 67 74 68 20 3d 3d 20 31 20 26 26 20 74 72 75 73 74 75 72 tallCerts.length.==.1.&&.trustur
3b00 6c 43 65 72 74 73 2e 6c 65 6e 67 74 68 20 3d 3d 20 31 29 20 7b 0a 2b 09 09 09 69 66 20 28 74 72 lCerts.length.==.1).{.+...if.(tr
3b20 75 73 74 61 6c 6c 43 65 72 74 73 5b 30 5d 2e 65 71 75 61 6c 73 28 74 72 75 73 74 75 72 6c 43 65 ustallCerts[0].equals(trusturlCe
3b40 72 74 73 5b 30 5d 29 29 20 7b 0a 2b 09 09 09 09 53 79 73 74 65 6d 2e 6f 75 74 2e 70 72 69 6e 74 rts[0])).{.+....System.out.print
3b60 6c 6e 28 6d 73 67 29 3b 0a 2b 09 09 09 09 72 65 74 75 72 6e 20 74 72 75 65 3b 0a 2b 09 09 09 7d ln(msg);.+....return.true;.+...}
3b80 0a 2b 09 09 20 20 20 20 7d 0a 2b 09 09 7d 0a 2b 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a .+......}.+..}.+..return.false;.
3ba0 2b 09 7d 0a 2b 0a 2b 09 70 75 62 6c 69 63 20 76 6f 69 64 20 63 68 65 63 6b 5f 66 6f 72 5f 70 72 +.}.+.+.public.void.check_for_pr
3bc0 6f 78 79 28 29 20 7b 0a 2b 09 09 0a 2b 09 09 62 6f 6f 6c 65 61 6e 20 72 65 73 75 6c 74 20 3d 20 oxy().{.+...+..boolean.result.=.
3be0 66 61 6c 73 65 3b 0a 2b 0a 2b 09 09 74 72 75 73 74 75 72 6c 43 65 72 74 73 20 3d 20 6e 75 6c 6c false;.+.+..trusturlCerts.=.null
3c00 3b 0a 2b 09 09 70 72 6f 78 79 5f 69 6e 5f 75 73 65 20 3d 20 66 61 6c 73 65 3b 0a 2b 09 09 69 66 ;.+..proxy_in_use.=.false;.+..if
3c20 20 28 76 69 65 77 65 72 2e 69 67 6e 6f 72 65 50 72 6f 78 79 29 20 7b 0a 2b 09 09 09 72 65 74 75 .(viewer.ignoreProxy).{.+...retu
3c40 72 6e 3b 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 53 74 72 69 6e 67 20 75 73 74 72 20 3d 20 22 68 74 74 rn;.+..}.+.+..String.ustr.=."htt
3c60 70 73 3a 2f 2f 22 20 2b 20 68 6f 73 74 20 2b 20 22 3a 22 3b 0a 2b 09 09 69 66 20 28 76 69 65 77 ps://".+.host.+.":";.+..if.(view
3c80 65 72 2e 68 74 74 70 73 50 6f 72 74 20 21 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 75 73 74 72 er.httpsPort.!=.null).{.+...ustr
3ca0 20 2b 3d 20 76 69 65 77 65 72 2e 68 74 74 70 73 50 6f 72 74 3b 0a 2b 09 09 7d 20 65 6c 73 65 20 .+=.viewer.httpsPort;.+..}.else.
3cc0 7b 0a 2b 09 09 09 75 73 74 72 20 2b 3d 20 70 6f 72 74 3b 09 2f 2f 20 68 6d 6d 6d 0a 2b 09 09 7d {.+...ustr.+=.port;.//.hmmm.+..}
3ce0 0a 2b 09 09 75 73 74 72 20 2b 3d 20 76 69 65 77 65 72 2e 75 72 6c 50 72 65 66 69 78 20 2b 20 22 .+..ustr.+=.viewer.urlPrefix.+."
3d00 2f 63 68 65 63 6b 2e 68 74 74 70 73 2e 70 72 6f 78 79 2e 63 6f 6e 6e 65 63 74 69 6f 6e 22 3b 0a /check.https.proxy.connection";.
3d20 2b 09 09 64 62 67 28 22 75 73 74 72 20 69 73 3a 20 22 20 2b 20 75 73 74 72 29 3b 0a 2b 0a 2b 0a +..dbg("ustr.is:.".+.ustr);.+.+.
3d40 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 55 52 4c 20 75 72 6c 20 3d 20 6e 65 77 20 55 52 4c 28 75 +..try.{.+...URL.url.=.new.URL(u
3d60 73 74 72 29 3b 0a 2b 09 09 09 48 74 74 70 73 55 52 4c 43 6f 6e 6e 65 63 74 69 6f 6e 20 68 74 74 str);.+...HttpsURLConnection.htt
3d80 70 73 20 3d 20 28 48 74 74 70 73 55 52 4c 43 6f 6e 6e 65 63 74 69 6f 6e 29 0a 2b 09 09 09 20 20 ps.=.(HttpsURLConnection).+.....
3da0 20 20 75 72 6c 2e 6f 70 65 6e 43 6f 6e 6e 65 63 74 69 6f 6e 28 29 3b 0a 2b 0a 2b 09 09 09 68 74 ..url.openConnection();.+.+...ht
3dc0 74 70 73 2e 73 65 74 55 73 65 43 61 63 68 65 73 28 66 61 6c 73 65 29 3b 0a 2b 09 09 09 68 74 74 tps.setUseCaches(false);.+...htt
3de0 70 73 2e 73 65 74 52 65 71 75 65 73 74 4d 65 74 68 6f 64 28 22 47 45 54 22 29 3b 0a 2b 09 09 09 ps.setRequestMethod("GET");.+...
3e00 68 74 74 70 73 2e 73 65 74 52 65 71 75 65 73 74 50 72 6f 70 65 72 74 79 28 22 50 72 61 67 6d 61 https.setRequestProperty("Pragma
3e20 22 2c 20 22 4e 6f 2d 43 61 63 68 65 22 29 3b 0a 2b 09 09 09 68 74 74 70 73 2e 73 65 74 52 65 71 ",."No-Cache");.+...https.setReq
3e40 75 65 73 74 50 72 6f 70 65 72 74 79 28 22 50 72 6f 78 79 2d 43 6f 6e 6e 65 63 74 69 6f 6e 22 2c uestProperty("Proxy-Connection",
3e60 0a 2b 09 09 09 20 20 20 20 22 4b 65 65 70 2d 41 6c 69 76 65 22 29 3b 0a 2b 09 09 09 68 74 74 70 .+......."Keep-Alive");.+...http
3e80 73 2e 73 65 74 44 6f 49 6e 70 75 74 28 74 72 75 65 29 3b 0a 2b 0a 2b 09 09 09 68 74 74 70 73 2e s.setDoInput(true);.+.+...https.
3ea0 63 6f 6e 6e 65 63 74 28 29 3b 0a 2b 0a 2b 09 09 09 74 72 75 73 74 75 72 6c 43 65 72 74 73 20 3d connect();.+.+...trusturlCerts.=
3ec0 20 68 74 74 70 73 2e 67 65 74 53 65 72 76 65 72 43 65 72 74 69 66 69 63 61 74 65 73 28 29 3b 0a .https.getServerCertificates();.
3ee0 2b 09 09 09 69 66 20 28 74 72 75 73 74 75 72 6c 43 65 72 74 73 20 3d 3d 20 6e 75 6c 6c 29 20 7b +...if.(trusturlCerts.==.null).{
3f00 0a 2b 09 09 09 09 64 62 67 28 22 73 65 74 20 74 72 75 73 74 75 72 6c 43 65 72 74 73 20 74 6f 20 .+....dbg("set.trusturlCerts.to.
3f20 6e 75 6c 6c 2e 2e 2e 22 29 3b 0a 2b 09 09 09 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 09 64 62 67 null...");.+...}.else.{.+....dbg
3f40 28 22 73 65 74 20 74 72 75 73 74 75 72 6c 43 65 72 74 73 20 74 6f 20 6e 6f 6e 2d 6e 75 6c 6c 22 ("set.trusturlCerts.to.non-null"
3f60 29 3b 0a 2b 09 09 09 7d 0a 2b 0a 2b 09 09 09 69 66 20 28 68 74 74 70 73 2e 75 73 69 6e 67 50 72 );.+...}.+.+...if.(https.usingPr
3f80 6f 78 79 28 29 29 20 7b 0a 2b 09 09 09 09 70 72 6f 78 79 5f 69 6e 5f 75 73 65 20 3d 20 74 72 75 oxy()).{.+....proxy_in_use.=.tru
3fa0 65 3b 0a 2b 09 09 09 09 70 72 6f 78 79 5f 69 73 5f 68 74 74 70 73 20 3d 20 74 72 75 65 3b 0a 2b e;.+....proxy_is_https.=.true;.+
3fc0 09 09 09 09 64 62 67 28 22 48 54 54 50 53 20 70 72 6f 78 79 20 69 6e 20 75 73 65 2e 20 54 68 65 ....dbg("HTTPS.proxy.in.use..The
3fe0 72 65 20 6d 61 79 20 62 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 70 72 6f 62 6c 65 6d 73 2e 22 29 re.may.be.connection.problems.")
4000 3b 0a 2b 09 09 09 7d 0a 2b 09 09 09 4f 62 6a 65 63 74 20 6f 75 74 70 75 74 20 3d 20 68 74 74 70 ;.+...}.+...Object.output.=.http
4020 73 2e 67 65 74 43 6f 6e 74 65 6e 74 28 29 3b 0a 2b 09 09 09 68 74 74 70 73 2e 64 69 73 63 6f 6e s.getContent();.+...https.discon
4040 6e 65 63 74 28 29 3b 0a 2b 09 09 09 72 65 73 75 6c 74 20 3d 20 74 72 75 65 3b 0a 2b 0a 2b 09 09 nect();.+...result.=.true;.+.+..
4060 7d 20 63 61 74 63 68 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 64 62 67 28 22 }.catch(Exception.e).{.+...dbg("
4080 48 74 74 70 73 55 52 4c 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 22 20 2b 20 65 2e 67 65 74 4d 65 73 HttpsURLConnection:.".+.e.getMes
40a0 73 61 67 65 28 29 29 3b 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 69 66 20 28 70 72 6f 78 79 5f 69 6e 5f sage());.+..}.+.+..if.(proxy_in_
40c0 75 73 65 29 20 7b 0a 2b 09 09 09 72 65 74 75 72 6e 3b 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 75 73 74 use).{.+...return;.+..}.+.+..ust
40e0 72 20 3d 20 22 68 74 74 70 3a 2f 2f 22 20 2b 20 68 6f 73 74 20 2b 20 22 3a 22 20 2b 20 70 6f 72 r.=."http://".+.host.+.":".+.por
4100 74 3b 0a 2b 09 09 75 73 74 72 20 2b 3d 20 76 69 65 77 65 72 2e 75 72 6c 50 72 65 66 69 78 20 2b t;.+..ustr.+=.viewer.urlPrefix.+
4120 20 22 2f 69 6e 64 65 78 2e 76 6e 63 22 3b 0a 2b 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 55 52 ."/index.vnc";.+.+..try.{.+...UR
4140 4c 20 75 72 6c 20 3d 20 6e 65 77 20 55 52 4c 28 75 73 74 72 29 3b 0a 2b 09 09 09 48 74 74 70 55 L.url.=.new.URL(ustr);.+...HttpU
4160 52 4c 43 6f 6e 6e 65 63 74 69 6f 6e 20 68 74 74 70 20 3d 20 28 48 74 74 70 55 52 4c 43 6f 6e 6e RLConnection.http.=.(HttpURLConn
4180 65 63 74 69 6f 6e 29 0a 2b 09 09 09 20 20 20 20 75 72 6c 2e 6f 70 65 6e 43 6f 6e 6e 65 63 74 69 ection).+.......url.openConnecti
41a0 6f 6e 28 29 3b 0a 2b 0a 2b 09 09 09 68 74 74 70 2e 73 65 74 55 73 65 43 61 63 68 65 73 28 66 61 on();.+.+...http.setUseCaches(fa
41c0 6c 73 65 29 3b 0a 2b 09 09 09 68 74 74 70 2e 73 65 74 52 65 71 75 65 73 74 4d 65 74 68 6f 64 28 lse);.+...http.setRequestMethod(
41e0 22 47 45 54 22 29 3b 0a 2b 09 09 09 68 74 74 70 2e 73 65 74 52 65 71 75 65 73 74 50 72 6f 70 65 "GET");.+...http.setRequestPrope
4200 72 74 79 28 22 50 72 61 67 6d 61 22 2c 20 22 4e 6f 2d 43 61 63 68 65 22 29 3b 0a 2b 09 09 09 68 rty("Pragma",."No-Cache");.+...h
4220 74 74 70 2e 73 65 74 52 65 71 75 65 73 74 50 72 6f 70 65 72 74 79 28 22 50 72 6f 78 79 2d 43 6f ttp.setRequestProperty("Proxy-Co
4240 6e 6e 65 63 74 69 6f 6e 22 2c 0a 2b 09 09 09 20 20 20 20 22 4b 65 65 70 2d 41 6c 69 76 65 22 29 nnection",.+......."Keep-Alive")
4260 3b 0a 2b 09 09 09 68 74 74 70 2e 73 65 74 44 6f 49 6e 70 75 74 28 74 72 75 65 29 3b 0a 2b 0a 2b ;.+...http.setDoInput(true);.+.+
4280 09 09 09 68 74 74 70 2e 63 6f 6e 6e 65 63 74 28 29 3b 0a 2b 0a 2b 09 09 09 69 66 20 28 68 74 74 ...http.connect();.+.+...if.(htt
42a0 70 2e 75 73 69 6e 67 50 72 6f 78 79 28 29 29 20 7b 0a 2b 09 09 09 09 70 72 6f 78 79 5f 69 6e 5f p.usingProxy()).{.+....proxy_in_
42c0 75 73 65 20 3d 20 74 72 75 65 3b 0a 2b 09 09 09 09 70 72 6f 78 79 5f 69 73 5f 68 74 74 70 73 20 use.=.true;.+....proxy_is_https.
42e0 3d 20 66 61 6c 73 65 3b 0a 2b 09 09 09 09 64 62 67 28 22 48 54 54 50 20 70 72 6f 78 79 20 69 6e =.false;.+....dbg("HTTP.proxy.in
4300 20 75 73 65 2e 20 54 68 65 72 65 20 6d 61 79 20 62 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 70 72 .use..There.may.be.connection.pr
4320 6f 62 6c 65 6d 73 2e 22 29 3b 0a 2b 09 09 09 7d 0a 2b 09 09 09 4f 62 6a 65 63 74 20 6f 75 74 70 oblems.");.+...}.+...Object.outp
4340 75 74 20 3d 20 68 74 74 70 2e 67 65 74 43 6f 6e 74 65 6e 74 28 29 3b 0a 2b 09 09 09 68 74 74 70 ut.=.http.getContent();.+...http
4360 2e 64 69 73 63 6f 6e 6e 65 63 74 28 29 3b 0a 2b 0a 2b 09 09 7d 20 63 61 74 63 68 28 45 78 63 65 .disconnect();.+.+..}.catch(Exce
4380 70 74 69 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 64 62 67 28 22 48 74 74 70 55 52 4c 43 6f 6e 6e 65 ption.e).{.+...dbg("HttpURLConne
43a0 63 74 69 6f 6e 3a 20 22 20 2b 20 65 2e 67 65 74 4d 65 73 73 61 67 65 28 29 29 3b 0a 2b 09 09 7d ction:.".+.e.getMessage());.+..}
43c0 0a 2b 09 7d 0a 2b 0a 2b 09 70 75 62 6c 69 63 20 53 6f 63 6b 65 74 20 63 6f 6e 6e 65 63 74 53 6f .+.}.+.+.public.Socket.connectSo
43e0 63 6b 28 29 20 74 68 72 6f 77 73 20 49 4f 45 78 63 65 70 74 69 6f 6e 20 7b 0a 2b 0a 2b 09 09 2f ck().throws.IOException.{.+.+../
4400 2a 0a 2b 09 09 20 2a 20 66 69 72 73 74 20 74 72 79 20 61 20 68 74 74 70 73 20 63 6f 6e 6e 65 63 *.+...*.first.try.a.https.connec
4420 74 69 6f 6e 20 74 6f 20 64 65 74 65 63 74 20 61 20 70 72 6f 78 79 2c 20 61 6e 64 0a 2b 09 09 20 tion.to.detect.a.proxy,.and.+...
4440 2a 20 61 6c 73 6f 20 67 72 61 62 20 74 68 65 20 56 4e 43 20 73 65 72 76 65 72 20 63 65 72 74 2e *.also.grab.the.VNC.server.cert.
4460 0a 2b 09 09 20 2a 2f 0a 2b 09 09 63 68 65 63 6b 5f 66 6f 72 5f 70 72 6f 78 79 28 29 3b 0a 2b 09 .+...*/.+..check_for_proxy();.+.
4480 09 0a 2b 09 09 69 66 20 28 76 69 65 77 65 72 2e 74 72 75 73 74 41 6c 6c 56 6e 63 43 65 72 74 73 ..+..if.(viewer.trustAllVncCerts
44a0 29 20 7b 0a 2b 09 09 09 64 62 67 28 22 76 69 65 77 65 72 2e 74 72 75 73 74 41 6c 6c 56 6e 63 43 ).{.+...dbg("viewer.trustAllVncC
44c0 65 72 74 73 2d 30 20 75 73 69 6e 67 20 74 72 75 73 74 61 6c 6c 5f 63 74 78 22 29 3b 0a 2b 09 09 erts-0.using.trustall_ctx");.+..
44e0 09 66 61 63 74 6f 72 79 20 3d 20 74 72 75 73 74 61 6c 6c 5f 63 74 78 2e 67 65 74 53 6f 63 6b 65 .factory.=.trustall_ctx.getSocke
4500 74 46 61 63 74 6f 72 79 28 29 3b 0a 2b 09 09 7d 20 65 6c 73 65 20 69 66 20 28 75 73 65 5f 75 72 tFactory();.+..}.else.if.(use_ur
4520 6c 5f 63 65 72 74 5f 66 6f 72 5f 61 75 74 68 20 26 26 20 74 72 75 73 74 75 72 6c 43 65 72 74 73 l_cert_for_auth.&&.trusturlCerts
4540 20 21 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 64 62 67 28 22 75 73 69 6e 67 20 74 72 75 73 74 .!=.null).{.+...dbg("using.trust
4560 75 72 6c 5f 63 74 78 22 29 3b 0a 2b 09 09 09 66 61 63 74 6f 72 79 20 3d 20 74 72 75 73 74 75 72 url_ctx");.+...factory.=.trustur
4580 6c 5f 63 74 78 2e 67 65 74 53 6f 63 6b 65 74 46 61 63 74 6f 72 79 28 29 3b 0a 2b 09 09 7d 20 65 l_ctx.getSocketFactory();.+..}.e
45a0 6c 73 65 20 7b 0a 2b 09 09 09 64 62 67 28 22 75 73 69 6e 67 20 74 72 75 73 74 6c 6f 63 5f 63 74 lse.{.+...dbg("using.trustloc_ct
45c0 78 22 29 3b 0a 2b 09 09 09 66 61 63 74 6f 72 79 20 3d 20 74 72 75 73 74 6c 6f 63 5f 63 74 78 2e x");.+...factory.=.trustloc_ctx.
45e0 67 65 74 53 6f 63 6b 65 74 46 61 63 74 6f 72 79 28 29 3b 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 73 6f getSocketFactory();.+..}.+.+..so
4600 63 6b 65 74 20 3d 20 6e 75 6c 6c 3b 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 69 66 20 28 70 72 cket.=.null;.+..try.{.+...if.(pr
4620 6f 78 79 5f 69 6e 5f 75 73 65 20 26 26 20 76 69 65 77 65 72 2e 66 6f 72 63 65 50 72 6f 78 79 29 oxy_in_use.&&.viewer.forceProxy)
4640 20 7b 0a 2b 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 22 66 6f 72 .{.+....throw.new.Exception("for
4660 63 69 6e 67 20 70 72 6f 78 79 20 28 66 6f 72 63 65 50 72 6f 78 79 29 22 29 3b 0a 2b 09 09 09 7d cing.proxy.(forceProxy)");.+...}
4680 20 65 6c 73 65 20 69 66 20 28 76 69 65 77 65 72 2e 43 4f 4e 4e 45 43 54 20 21 3d 20 6e 75 6c 6c .else.if.(viewer.CONNECT.!=.null
46a0 29 20 7b 0a 2b 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 22 66 6f ).{.+....throw.new.Exception("fo
46c0 72 63 69 6e 67 20 43 4f 4e 4e 45 43 54 22 29 3b 0a 2b 09 09 09 7d 0a 2b 0a 2b 09 09 09 73 6f 63 rcing.CONNECT");.+...}.+.+...soc
46e0 6b 65 74 20 3d 20 28 53 53 4c 53 6f 63 6b 65 74 29 20 66 61 63 74 6f 72 79 2e 63 72 65 61 74 65 ket.=.(SSLSocket).factory.create
4700 53 6f 63 6b 65 74 28 68 6f 73 74 2c 20 70 6f 72 74 29 3b 0a 2b 0a 2b 09 09 7d 20 63 61 74 63 68 Socket(host,.port);.+.+..}.catch
4720 20 28 45 78 63 65 70 74 69 6f 6e 20 65 73 6f 63 6b 29 20 7b 0a 2b 09 09 09 64 62 67 28 22 65 73 .(Exception.esock).{.+...dbg("es
4740 6f 63 6b 3a 20 22 20 2b 20 65 73 6f 63 6b 2e 67 65 74 4d 65 73 73 61 67 65 28 29 29 3b 0a 2b 09 ock:.".+.esock.getMessage());.+.
4760 09 09 69 66 20 28 70 72 6f 78 79 5f 69 6e 5f 75 73 65 20 7c 7c 20 76 69 65 77 65 72 2e 43 4f 4e ..if.(proxy_in_use.||.viewer.CON
4780 4e 45 43 54 20 21 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 09 70 72 6f 78 79 5f 66 61 69 6c 75 NECT.!=.null).{.+....proxy_failu
47a0 72 65 20 3d 20 74 72 75 65 3b 0a 2b 09 09 09 09 69 66 20 28 70 72 6f 78 79 5f 69 6e 5f 75 73 65 re.=.true;.+....if.(proxy_in_use
47c0 29 20 7b 0a 2b 09 09 09 09 09 64 62 67 28 22 48 54 54 50 53 20 70 72 6f 78 79 20 69 6e 20 75 73 ).{.+.....dbg("HTTPS.proxy.in.us
47e0 65 2e 20 54 72 79 69 6e 67 20 74 6f 20 67 6f 20 77 69 74 68 20 69 74 2e 22 29 3b 0a 2b 09 09 09 e..Trying.to.go.with.it.");.+...
4800 09 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 09 09 64 62 67 28 22 76 69 65 77 65 72 2e 43 4f 4e 4e .}.else.{.+.....dbg("viewer.CONN
4820 45 43 54 20 72 65 76 65 72 73 65 20 70 72 6f 78 79 20 69 6e 20 75 73 65 2e 20 54 72 79 69 6e 67 ECT.reverse.proxy.in.use..Trying
4840 20 74 6f 20 67 6f 20 77 69 74 68 20 69 74 2e 22 29 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 74 .to.go.with.it.");.+....}.+....t
4860 72 79 20 7b 0a 2b 09 09 09 09 09 73 6f 63 6b 65 74 20 3d 20 70 72 6f 78 79 5f 73 6f 63 6b 65 74 ry.{.+.....socket.=.proxy_socket
4880 28 66 61 63 74 6f 72 79 29 3b 0a 2b 09 09 09 09 7d 20 63 61 74 63 68 20 28 45 78 63 65 70 74 69 (factory);.+....}.catch.(Excepti
48a0 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 09 09 64 62 67 28 22 65 72 72 20 70 72 6f 78 79 5f 73 6f 63 on.e).{.+.....dbg("err.proxy_soc
48c0 6b 65 74 3a 20 22 20 2b 20 65 2e 67 65 74 4d 65 73 73 61 67 65 28 29 29 3b 0a 2b 09 09 09 09 7d ket:.".+.e.getMessage());.+....}
48e0 0a 2b 09 09 09 7d 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 73 6f 63 6b 65 .+...}.+..}.+.+..try.{.+...socke
4900 74 2e 73 74 61 72 74 48 61 6e 64 73 68 61 6b 65 28 29 3b 0a 2b 09 09 09 64 62 67 28 22 53 65 72 t.startHandshake();.+...dbg("Ser
4920 76 65 72 20 43 6f 6e 6e 65 63 74 69 6f 6e 20 56 65 72 69 66 69 65 64 20 6f 6e 20 31 73 74 20 74 ver.Connection.Verified.on.1st.t
4940 72 79 2e 22 29 3b 0a 2b 0a 2b 09 09 09 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e ry.");.+.+...java.security.cert.
4960 43 65 72 74 69 66 69 63 61 74 65 5b 5d 20 63 75 72 72 65 6e 74 54 72 75 73 74 65 64 43 65 72 74 Certificate[].currentTrustedCert
4980 73 3b 0a 2b 09 09 09 42 72 6f 77 73 65 72 43 65 72 74 73 44 69 61 6c 6f 67 20 62 63 64 3b 0a 2b s;.+...BrowserCertsDialog.bcd;.+
49a0 0a 2b 09 09 09 53 53 4c 53 65 73 73 69 6f 6e 20 73 65 73 73 20 3d 20 73 6f 63 6b 65 74 2e 67 65 .+...SSLSession.sess.=.socket.ge
49c0 74 53 65 73 73 69 6f 6e 28 29 3b 0a 2b 09 09 09 63 75 72 72 65 6e 74 54 72 75 73 74 65 64 43 65 tSession();.+...currentTrustedCe
49e0 72 74 73 20 3d 20 73 65 73 73 2e 67 65 74 50 65 65 72 43 65 72 74 69 66 69 63 61 74 65 73 28 29 rts.=.sess.getPeerCertificates()
4a00 3b 0a 2b 0a 2b 09 09 09 69 66 20 28 76 69 65 77 65 72 2e 74 72 75 73 74 41 6c 6c 56 6e 63 43 65 ;.+.+...if.(viewer.trustAllVncCe
4a20 72 74 73 29 20 7b 0a 2b 09 09 09 09 64 62 67 28 22 76 69 65 77 65 72 2e 74 72 75 73 74 41 6c 6c rts).{.+....dbg("viewer.trustAll
4a40 56 6e 63 43 65 72 74 73 2d 31 22 29 3b 0a 2b 09 09 09 7d 20 65 6c 73 65 20 69 66 20 28 63 75 72 VncCerts-1");.+...}.else.if.(cur
4a60 72 65 6e 74 54 72 75 73 74 65 64 43 65 72 74 73 20 3d 3d 20 6e 75 6c 6c 20 7c 7c 20 63 75 72 72 rentTrustedCerts.==.null.||.curr
4a80 65 6e 74 54 72 75 73 74 65 64 43 65 72 74 73 2e 6c 65 6e 67 74 68 20 3c 20 31 29 20 7b 0a 2b 09 entTrustedCerts.length.<.1).{.+.
4aa0 09 09 09 73 6f 63 6b 65 74 2e 63 6c 6f 73 65 28 29 3b 0a 2b 09 09 09 09 73 6f 63 6b 65 74 20 3d ...socket.close();.+....socket.=
4ac0 20 6e 75 6c 6c 3b 0a 2b 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 53 53 4c 48 61 6e 64 73 68 61 .null;.+....throw.new.SSLHandsha
4ae0 6b 65 45 78 63 65 70 74 69 6f 6e 28 22 6e 6f 20 63 75 72 72 65 6e 74 20 63 65 72 74 73 22 29 3b keException("no.current.certs");
4b00 0a 2b 09 09 09 7d 0a 2b 0a 2b 09 09 09 53 74 72 69 6e 67 20 73 65 72 76 20 3d 20 22 22 3b 0a 2b .+...}.+.+...String.serv.=."";.+
4b20 09 09 09 74 72 79 20 7b 0a 2b 09 09 09 09 43 65 72 74 49 6e 66 6f 20 63 69 20 3d 20 6e 65 77 20 ...try.{.+....CertInfo.ci.=.new.
4b40 43 65 72 74 49 6e 66 6f 28 63 75 72 72 65 6e 74 54 72 75 73 74 65 64 43 65 72 74 73 5b 30 5d 29 CertInfo(currentTrustedCerts[0])
4b60 3b 0a 2b 09 09 09 09 73 65 72 76 20 3d 20 63 69 2e 67 65 74 5f 63 65 72 74 69 6e 66 6f 28 22 43 ;.+....serv.=.ci.get_certinfo("C
4b80 4e 22 29 3b 0a 2b 09 09 09 7d 20 63 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b N");.+...}.catch.(Exception.e).{
4ba0 0a 2b 09 09 09 09 3b 0a 2b 09 09 09 7d 0a 2b 0a 2b 09 09 09 69 66 20 28 76 69 65 77 65 72 2e 74 .+....;.+...}.+.+...if.(viewer.t
4bc0 72 75 73 74 41 6c 6c 56 6e 63 43 65 72 74 73 29 20 7b 0a 2b 09 09 09 09 64 62 67 28 22 76 69 65 rustAllVncCerts).{.+....dbg("vie
4be0 77 65 72 2e 74 72 75 73 74 41 6c 6c 56 6e 63 43 65 72 74 73 2d 32 22 29 3b 0a 2b 09 09 09 09 75 wer.trustAllVncCerts-2");.+....u
4c00 73 65 72 5f 77 61 6e 74 73 5f 74 6f 5f 73 65 65 5f 63 65 72 74 20 3d 20 66 61 6c 73 65 3b 0a 2b ser_wants_to_see_cert.=.false;.+
4c20 09 09 09 7d 20 65 6c 73 65 20 69 66 20 28 76 69 65 77 65 72 2e 74 72 75 73 74 55 72 6c 56 6e 63 ...}.else.if.(viewer.trustUrlVnc
4c40 43 65 72 74 29 20 7b 0a 2b 09 09 09 09 64 62 67 28 22 76 69 65 77 65 72 2e 74 72 75 73 74 55 72 Cert).{.+....dbg("viewer.trustUr
4c60 6c 56 6e 63 43 65 72 74 2d 31 22 29 3b 0a 2b 09 09 09 09 75 73 65 72 5f 77 61 6e 74 73 5f 74 6f lVncCert-1");.+....user_wants_to
4c80 5f 73 65 65 5f 63 65 72 74 20 3d 20 66 61 6c 73 65 3b 0a 2b 09 09 09 7d 20 65 6c 73 65 20 7b 0a _see_cert.=.false;.+...}.else.{.
4ca0 2b 09 09 09 09 62 63 64 20 3d 20 6e 65 77 20 42 72 6f 77 73 65 72 43 65 72 74 73 44 69 61 6c 6f +....bcd.=.new.BrowserCertsDialo
4cc0 67 28 73 65 72 76 2c 20 68 6f 73 74 20 2b 20 22 3a 22 20 2b 20 70 6f 72 74 29 3b 0a 2b 09 09 09 g(serv,.host.+.":".+.port);.+...
4ce0 09 62 63 64 2e 71 75 65 72 79 55 73 65 72 28 29 3b 0a 2b 09 09 09 09 69 66 20 28 62 63 64 2e 73 .bcd.queryUser();.+....if.(bcd.s
4d00 68 6f 77 43 65 72 74 44 69 61 6c 6f 67 29 20 7b 0a 2b 09 09 09 09 09 53 74 72 69 6e 67 20 6d 73 howCertDialog).{.+.....String.ms
4d20 67 20 3d 20 22 75 73 65 72 20 77 61 6e 74 73 20 74 6f 20 73 65 65 20 63 65 72 74 22 3b 0a 2b 09 g.=."user.wants.to.see.cert";.+.
4d40 09 09 09 09 64 62 67 28 6d 73 67 29 3b 0a 2b 09 09 09 09 09 75 73 65 72 5f 77 61 6e 74 73 5f 74 ....dbg(msg);.+.....user_wants_t
4d60 6f 5f 73 65 65 5f 63 65 72 74 20 3d 20 74 72 75 65 3b 0a 2b 09 09 09 09 09 74 68 72 6f 77 20 6e o_see_cert.=.true;.+.....throw.n
4d80 65 77 20 53 53 4c 48 61 6e 64 73 68 61 6b 65 45 78 63 65 70 74 69 6f 6e 28 6d 73 67 29 3b 0a 2b ew.SSLHandshakeException(msg);.+
4da0 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 09 09 75 73 65 72 5f 77 61 6e 74 73 5f 74 6f ....}.else.{.+.....user_wants_to
4dc0 5f 73 65 65 5f 63 65 72 74 20 3d 20 66 61 6c 73 65 3b 0a 2b 09 09 09 09 09 64 62 67 28 22 62 63 _see_cert.=.false;.+.....dbg("bc
4de0 64 3a 20 75 73 65 72 20 73 61 69 64 20 79 65 73 2c 20 61 63 63 65 70 74 20 69 74 22 29 3b 0a 2b d:.user.said.yes,.accept.it");.+
4e00 09 09 09 09 7d 0a 2b 09 09 09 7d 0a 2b 0a 2b 09 09 7d 20 63 61 74 63 68 20 28 53 53 4c 48 61 6e ....}.+...}.+.+..}.catch.(SSLHan
4e20 64 73 68 61 6b 65 45 78 63 65 70 74 69 6f 6e 20 65 68 29 20 20 7b 0a 2b 09 09 09 64 62 67 28 22 dshakeException.eh)..{.+...dbg("
4e40 43 6f 75 6c 64 20 6e 6f 74 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 76 65 72 69 66 79 20 53 Could.not.automatically.verify.S
4e60 65 72 76 65 72 2e 22 29 3b 0a 2b 09 09 09 64 62 67 28 22 6d 73 67 3a 20 22 20 2b 20 65 68 2e 67 erver.");.+...dbg("msg:.".+.eh.g
4e80 65 74 4d 65 73 73 61 67 65 28 29 29 3b 0a 2b 0a 2b 09 09 09 73 6f 63 6b 65 74 2e 63 6c 6f 73 65 etMessage());.+.+...socket.close
4ea0 28 29 3b 0a 2b 09 09 09 73 6f 63 6b 65 74 20 3d 20 6e 75 6c 6c 3b 0a 2b 0a 2b 09 09 09 2f 2a 0a ();.+...socket.=.null;.+.+.../*.
4ec0 2b 09 09 09 20 2a 20 52 65 63 6f 6e 6e 65 63 74 2c 20 74 72 75 73 74 69 6e 67 20 61 6e 79 20 63 +....*.Reconnect,.trusting.any.c
4ee0 65 72 74 2c 20 73 6f 20 77 65 20 63 61 6e 20 67 72 61 62 0a 2b 09 09 09 20 2a 20 74 68 65 20 63 ert,.so.we.can.grab.+....*.the.c
4f00 65 72 74 20 74 6f 20 73 68 6f 77 20 69 74 20 74 6f 20 74 68 65 20 75 73 65 72 2e 20 20 54 68 65 ert.to.show.it.to.the.user...The
4f20 20 63 6f 6e 6e 65 63 74 69 6f 6e 0a 2b 09 09 09 20 2a 20 69 73 20 6e 6f 74 20 75 73 65 64 20 66 .connection.+....*.is.not.used.f
4f40 6f 72 20 61 6e 79 74 68 69 6e 67 20 65 6c 73 65 2e 0a 2b 09 09 09 20 2a 2f 0a 2b 09 09 09 66 61 or.anything.else..+....*/.+...fa
4f60 63 74 6f 72 79 20 3d 20 74 72 75 73 74 61 6c 6c 5f 63 74 78 2e 67 65 74 53 6f 63 6b 65 74 46 61 ctory.=.trustall_ctx.getSocketFa
4f80 63 74 6f 72 79 28 29 3b 0a 2b 09 09 09 69 66 20 28 70 72 6f 78 79 5f 66 61 69 6c 75 72 65 29 20 ctory();.+...if.(proxy_failure).
4fa0 7b 0a 2b 09 09 09 09 73 6f 63 6b 65 74 20 3d 20 70 72 6f 78 79 5f 73 6f 63 6b 65 74 28 66 61 63 {.+....socket.=.proxy_socket(fac
4fc0 74 6f 72 79 29 3b 0a 2b 09 09 09 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 09 73 6f 63 6b 65 74 20 tory);.+...}.else.{.+....socket.
4fe0 3d 20 28 53 53 4c 53 6f 63 6b 65 74 29 20 66 61 63 74 6f 72 79 2e 63 72 65 61 74 65 53 6f 63 6b =.(SSLSocket).factory.createSock
5000 65 74 28 68 6f 73 74 2c 20 70 6f 72 74 29 3b 0a 2b 09 09 09 7d 0a 2b 0a 2b 09 09 09 74 72 79 20 et(host,.port);.+...}.+.+...try.
5020 7b 0a 2b 09 09 09 09 73 6f 63 6b 65 74 2e 73 74 61 72 74 48 61 6e 64 73 68 61 6b 65 28 29 3b 0a {.+....socket.startHandshake();.
5040 2b 09 09 09 09 64 62 67 28 22 54 72 75 73 74 41 6c 6c 20 53 65 72 76 65 72 20 43 6f 6e 6e 65 63 +....dbg("TrustAll.Server.Connec
5060 74 69 6f 6e 20 56 65 72 69 66 69 65 64 2e 22 29 3b 0a 2b 0a 2b 09 09 09 09 2f 2a 20 67 72 61 62 tion.Verified.");.+.+..../*.grab
5080 20 74 68 65 20 63 65 72 74 3a 20 2a 2f 0a 2b 09 09 09 09 74 72 79 20 7b 0a 2b 09 09 09 09 09 53 .the.cert:.*/.+....try.{.+.....S
50a0 53 4c 53 65 73 73 69 6f 6e 20 73 65 73 73 20 3d 20 73 6f 63 6b 65 74 2e 67 65 74 53 65 73 73 69 SLSession.sess.=.socket.getSessi
50c0 6f 6e 28 29 3b 0a 2b 09 09 09 09 09 74 72 75 73 74 61 6c 6c 43 65 72 74 73 20 3d 20 73 65 73 73 on();.+.....trustallCerts.=.sess
50e0 2e 67 65 74 50 65 65 72 43 65 72 74 69 66 69 63 61 74 65 73 28 29 3b 0a 2b 09 09 09 09 7d 20 63 .getPeerCertificates();.+....}.c
5100 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 09 09 74 68 72 6f 77 atch.(Exception.e).{.+.....throw
5120 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 22 43 6f 75 6c 64 20 6e 6f 74 20 67 65 74 20 22 20 .new.Exception("Could.not.get.".
5140 2b 20 0a 2b 09 09 09 09 09 20 20 20 20 22 50 65 65 72 20 43 65 72 74 69 66 69 63 61 74 65 22 29 +..+........."Peer.Certificate")
5160 3b 09 0a 2b 09 09 09 09 7d 0a 2b 0a 2b 09 09 09 09 69 66 20 28 76 69 65 77 65 72 2e 74 72 75 73 ;..+....}.+.+....if.(viewer.trus
5180 74 41 6c 6c 56 6e 63 43 65 72 74 73 29 20 7b 0a 2b 09 09 09 09 09 64 62 67 28 22 76 69 65 77 65 tAllVncCerts).{.+.....dbg("viewe
51a0 72 2e 74 72 75 73 74 41 6c 6c 56 6e 63 43 65 72 74 73 2d 33 22 29 3b 0a 2b 09 09 09 09 7d 20 65 r.trustAllVncCerts-3");.+....}.e
51c0 6c 73 65 20 69 66 20 28 21 20 62 72 6f 77 73 65 72 5f 63 65 72 74 5f 6d 61 74 63 68 28 29 29 20 lse.if.(!.browser_cert_match()).
51e0 7b 0a 2b 09 09 09 09 09 2f 2a 0a 2b 09 09 09 09 09 20 2a 20 63 6c 6f 73 65 20 73 6f 63 6b 65 74 {.+...../*.+......*.close.socket
5200 20 6e 6f 77 2c 20 77 65 20 77 69 6c 6c 20 72 65 6f 70 65 6e 20 61 66 74 65 72 0a 2b 09 09 09 09 .now,.we.will.reopen.after.+....
5220 09 20 2a 20 64 69 61 6c 6f 67 20 69 66 20 75 73 65 72 20 61 67 72 65 65 73 20 74 6f 20 75 73 65 ..*.dialog.if.user.agrees.to.use
5240 20 74 68 65 20 63 65 72 74 2e 0a 2b 09 09 09 09 09 20 2a 2f 0a 2b 09 09 09 09 09 73 6f 63 6b 65 .the.cert..+......*/.+.....socke
5260 74 2e 63 6c 6f 73 65 28 29 3b 0a 2b 09 09 09 09 09 73 6f 63 6b 65 74 20 3d 20 6e 75 6c 6c 3b 0a t.close();.+.....socket.=.null;.
5280 2b 0a 2b 09 09 09 09 09 2f 2a 20 64 69 61 6c 6f 67 20 77 69 74 68 20 75 73 65 72 20 74 6f 20 61 +.+...../*.dialog.with.user.to.a
52a0 63 63 65 70 74 20 63 65 72 74 20 6f 72 20 6e 6f 74 3a 20 2a 2f 0a 2b 0a 2b 09 09 09 09 09 54 72 ccept.cert.or.not:.*/.+.+.....Tr
52c0 75 73 74 44 69 61 6c 6f 67 20 74 64 3d 20 6e 65 77 20 54 72 75 73 74 44 69 61 6c 6f 67 28 68 6f ustDialog.td=.new.TrustDialog(ho
52e0 73 74 2c 20 70 6f 72 74 2c 0a 2b 09 09 09 09 09 20 20 20 20 74 72 75 73 74 61 6c 6c 43 65 72 74 st,.port,.+.........trustallCert
5300 73 29 3b 0a 2b 0a 2b 09 09 09 09 09 69 66 20 28 21 20 74 64 2e 71 75 65 72 79 55 73 65 72 28 29 s);.+.+.....if.(!.td.queryUser()
5320 29 20 7b 0a 2b 09 09 09 09 09 09 53 74 72 69 6e 67 20 6d 73 67 20 3d 20 22 55 73 65 72 20 64 65 ).{.+......String.msg.=."User.de
5340 63 69 64 65 64 20 61 67 61 69 6e 73 74 20 69 74 2e 22 3b 0a 2b 09 09 09 09 09 09 64 62 67 28 6d cided.against.it.";.+......dbg(m
5360 73 67 29 3b 0a 2b 09 09 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 49 4f 45 78 63 65 70 74 69 6f sg);.+......throw.new.IOExceptio
5380 6e 28 6d 73 67 29 3b 0a 2b 09 09 09 09 09 7d 0a 2b 09 09 09 09 7d 0a 2b 0a 2b 09 09 09 7d 20 63 n(msg);.+.....}.+....}.+.+...}.c
53a0 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 65 68 61 6e 64 32 29 20 20 7b 0a 2b 09 09 09 09 atch.(Exception.ehand2)..{.+....
53c0 64 62 67 28 22 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 54 72 75 73 74 41 6c 6c 20 56 65 72 69 66 dbg("**.Could.not.TrustAll.Verif
53e0 79 20 53 65 72 76 65 72 2e 22 29 3b 0a 2b 0a 2b 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 49 4f y.Server.");.+.+....throw.new.IO
5400 45 78 63 65 70 74 69 6f 6e 28 65 68 61 6e 64 32 2e 67 65 74 4d 65 73 73 61 67 65 28 29 29 3b 0a Exception(ehand2.getMessage());.
5420 2b 09 09 09 7d 0a 2b 0a 2b 09 09 09 2f 2a 0a 2b 09 09 09 20 2a 20 4e 6f 77 20 63 6f 6e 6e 65 63 +...}.+.+.../*.+....*.Now.connec
5440 74 20 61 20 33 72 64 20 74 69 6d 65 2c 20 75 73 69 6e 67 20 74 68 65 20 63 65 72 74 0a 2b 09 09 t.a.3rd.time,.using.the.cert.+..
5460 09 20 2a 20 72 65 74 72 69 65 76 65 64 20 64 75 72 69 6e 67 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 ..*.retrieved.during.connection.
5480 32 20 28 74 68 61 74 20 74 68 65 20 75 73 65 72 0a 2b 09 09 09 20 2a 20 6c 69 6b 65 6c 79 20 62 2.(that.the.user.+....*.likely.b
54a0 6c 69 6e 64 6c 79 20 61 67 72 65 65 64 20 74 6f 29 2e 0a 2b 09 09 09 20 2a 2f 0a 2b 0a 2b 09 09 lindly.agreed.to)..+....*/.+.+..
54c0 09 66 61 63 74 6f 72 79 20 3d 20 74 72 75 73 74 6f 6e 65 5f 63 74 78 2e 67 65 74 53 6f 63 6b 65 .factory.=.trustone_ctx.getSocke
54e0 74 46 61 63 74 6f 72 79 28 29 3b 0a 2b 09 09 09 69 66 20 28 70 72 6f 78 79 5f 66 61 69 6c 75 72 tFactory();.+...if.(proxy_failur
5500 65 29 20 7b 0a 2b 09 09 09 09 73 6f 63 6b 65 74 20 3d 20 70 72 6f 78 79 5f 73 6f 63 6b 65 74 28 e).{.+....socket.=.proxy_socket(
5520 66 61 63 74 6f 72 79 29 3b 0a 2b 09 09 09 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 09 73 6f 63 6b factory);.+...}.else.{.+....sock
5540 65 74 20 3d 20 28 53 53 4c 53 6f 63 6b 65 74 29 20 66 61 63 74 6f 72 79 2e 63 72 65 61 74 65 53 et.=.(SSLSocket).factory.createS
5560 6f 63 6b 65 74 28 68 6f 73 74 2c 20 70 6f 72 74 29 3b 0a 2b 09 09 09 7d 0a 2b 0a 2b 09 09 09 74 ocket(host,.port);.+...}.+.+...t
5580 72 79 20 7b 0a 2b 09 09 09 09 73 6f 63 6b 65 74 2e 73 74 61 72 74 48 61 6e 64 73 68 61 6b 65 28 ry.{.+....socket.startHandshake(
55a0 29 3b 0a 2b 09 09 09 09 64 62 67 28 22 54 72 75 73 74 41 6c 6c 20 53 65 72 76 65 72 20 43 6f 6e );.+....dbg("TrustAll.Server.Con
55c0 6e 65 63 74 69 6f 6e 20 56 65 72 69 66 69 65 64 20 23 33 2e 22 29 3b 0a 2b 0a 2b 09 09 09 7d 20 nection.Verified.#3.");.+.+...}.
55e0 63 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 65 68 61 6e 64 33 29 20 20 7b 0a 2b 09 09 09 catch.(Exception.ehand3)..{.+...
5600 09 64 62 67 28 22 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 54 72 75 73 74 41 6c 6c 20 56 65 72 69 .dbg("**.Could.not.TrustAll.Veri
5620 66 79 20 53 65 72 76 65 72 20 23 33 2e 22 29 3b 0a 2b 0a 2b 09 09 09 09 74 68 72 6f 77 20 6e 65 fy.Server.#3.");.+.+....throw.ne
5640 77 20 49 4f 45 78 63 65 70 74 69 6f 6e 28 65 68 61 6e 64 33 2e 67 65 74 4d 65 73 73 61 67 65 28 w.IOException(ehand3.getMessage(
5660 29 29 3b 0a 2b 09 09 09 7d 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 69 66 20 28 73 6f 63 6b 65 74 20 21 ));.+...}.+..}.+.+..if.(socket.!
5680 3d 20 6e 75 6c 6c 20 26 26 20 76 69 65 77 65 72 2e 47 45 54 29 20 7b 0a 2b 09 09 09 53 74 72 69 =.null.&&.viewer.GET).{.+...Stri
56a0 6e 67 20 73 74 72 20 3d 20 22 47 45 54 20 22 3b 0a 2b 09 09 09 73 74 72 20 2b 3d 20 76 69 65 77 ng.str.=."GET.";.+...str.+=.view
56c0 65 72 2e 75 72 6c 50 72 65 66 69 78 3b 0a 2b 09 09 09 73 74 72 20 2b 3d 20 22 2f 72 65 71 75 65 er.urlPrefix;.+...str.+=."/reque
56e0 73 74 2e 68 74 74 70 73 2e 76 6e 63 2e 63 6f 6e 6e 65 63 74 69 6f 6e 22 3b 0a 2b 09 09 09 73 74 st.https.vnc.connection";.+...st
5700 72 20 2b 3d 20 22 20 48 54 54 50 2f 31 2e 30 5c 72 5c 6e 22 3b 0a 2b 09 09 09 73 74 72 20 2b 3d r.+=.".HTTP/1.0\r\n";.+...str.+=
5720 20 22 50 72 61 67 6d 61 3a 20 4e 6f 2d 43 61 63 68 65 5c 72 5c 6e 22 3b 0a 2b 09 09 09 73 74 72 ."Pragma:.No-Cache\r\n";.+...str
5740 20 2b 3d 20 22 5c 72 5c 6e 22 3b 0a 2b 09 09 09 53 79 73 74 65 6d 2e 6f 75 74 2e 70 72 69 6e 74 .+=."\r\n";.+...System.out.print
5760 6c 6e 28 22 73 65 6e 64 69 6e 67 20 47 45 54 3a 20 22 20 2b 20 73 74 72 29 3b 0a 2b 20 20 20 20 ln("sending.GET:.".+.str);.+....
5780 09 09 09 4f 75 74 70 75 74 53 74 72 65 61 6d 20 6f 73 20 3d 20 73 6f 63 6b 65 74 2e 67 65 74 4f ...OutputStream.os.=.socket.getO
57a0 75 74 70 75 74 53 74 72 65 61 6d 28 29 3b 0a 2b 09 09 09 6f 73 2e 77 72 69 74 65 28 73 74 72 2e utputStream();.+...os.write(str.
57c0 67 65 74 42 79 74 65 73 28 29 29 3b 0a 2b 09 09 09 6f 73 2e 66 6c 75 73 68 28 29 3b 0a 2b 09 09 getBytes());.+...os.flush();.+..
57e0 09 69 66 20 28 66 61 6c 73 65 29 20 7b 0a 2b 09 09 09 09 53 74 72 69 6e 67 20 72 65 70 20 3d 20 .if.(false).{.+....String.rep.=.
5800 22 22 3b 0a 2b 09 09 09 09 44 61 74 61 49 6e 70 75 74 53 74 72 65 61 6d 20 69 73 20 3d 20 6e 65 "";.+....DataInputStream.is.=.ne
5820 77 20 44 61 74 61 49 6e 70 75 74 53 74 72 65 61 6d 28 0a 2b 09 09 09 09 20 20 20 20 6e 65 77 20 w.DataInputStream(.+........new.
5840 42 75 66 66 65 72 65 64 49 6e 70 75 74 53 74 72 65 61 6d 28 73 6f 63 6b 65 74 2e 67 65 74 49 6e BufferedInputStream(socket.getIn
5860 70 75 74 53 74 72 65 61 6d 28 29 2c 20 31 36 33 38 34 29 29 3b 0a 2b 09 09 09 09 77 68 69 6c 65 putStream(),.16384));.+....while
5880 20 28 74 72 75 65 29 20 7b 0a 2b 09 09 09 09 09 72 65 70 20 2b 3d 20 72 65 61 64 6c 69 6e 65 28 .(true).{.+.....rep.+=.readline(
58a0 69 73 29 3b 0a 2b 09 09 09 09 09 69 66 20 28 72 65 70 2e 69 6e 64 65 78 4f 66 28 22 5c 72 5c 6e is);.+.....if.(rep.indexOf("\r\n
58c0 5c 72 5c 6e 22 29 20 3e 3d 20 30 29 20 7b 0a 2b 09 09 09 09 09 09 62 72 65 61 6b 3b 0a 2b 09 09 \r\n").>=.0).{.+......break;.+..
58e0 09 09 09 7d 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 53 79 73 74 65 6d 2e 6f 75 74 2e 70 72 69 6e ...}.+....}.+....System.out.prin
5900 74 6c 6e 28 22 72 65 70 3a 20 22 20 2b 20 72 65 70 29 3b 0a 2b 09 09 09 7d 0a 2b 09 09 7d 0a 2b tln("rep:.".+.rep);.+...}.+..}.+
5920 0a 2b 09 09 64 62 67 28 22 53 53 4c 20 72 65 74 75 72 6e 69 6e 67 20 73 6f 63 6b 65 74 20 74 6f .+..dbg("SSL.returning.socket.to
5940 20 63 61 6c 6c 65 72 2e 22 29 3b 0a 2b 09 09 72 65 74 75 72 6e 20 28 53 6f 63 6b 65 74 29 20 73 .caller.");.+..return.(Socket).s
5960 6f 63 6b 65 74 3b 0a 2b 09 7d 0a 2b 0a 2b 09 70 72 69 76 61 74 65 20 76 6f 69 64 20 64 62 67 28 ocket;.+.}.+.+.private.void.dbg(
5980 53 74 72 69 6e 67 20 73 29 20 7b 0a 2b 09 09 69 66 20 28 64 65 62 75 67 29 20 7b 0a 2b 09 09 09 String.s).{.+..if.(debug).{.+...
59a0 53 79 73 74 65 6d 2e 6f 75 74 2e 70 72 69 6e 74 6c 6e 28 73 29 3b 0a 2b 09 09 7d 0a 2b 09 7d 0a System.out.println(s);.+..}.+.}.
59c0 2b 0a 2b 09 70 72 69 76 61 74 65 20 69 6e 74 20 67 69 6e 74 28 53 74 72 69 6e 67 20 73 29 20 7b +.+.private.int.gint(String.s).{
59e0 0a 2b 09 09 69 6e 74 20 6e 20 3d 20 2d 31 3b 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 49 6e 74 .+..int.n.=.-1;.+..try.{.+...Int
5a00 65 67 65 72 20 49 20 3d 20 6e 65 77 20 49 6e 74 65 67 65 72 28 73 29 3b 0a 2b 09 09 09 6e 20 3d eger.I.=.new.Integer(s);.+...n.=
5a20 20 49 2e 69 6e 74 56 61 6c 75 65 28 29 3b 0a 2b 09 09 7d 20 63 61 74 63 68 20 28 45 78 63 65 70 .I.intValue();.+..}.catch.(Excep
5a40 74 69 6f 6e 20 65 78 29 20 7b 0a 2b 09 09 09 72 65 74 75 72 6e 20 2d 31 3b 0a 2b 09 09 7d 0a 2b tion.ex).{.+...return.-1;.+..}.+
5a60 09 09 72 65 74 75 72 6e 20 6e 3b 0a 2b 09 7d 0a 2b 0a 2b 09 70 75 62 6c 69 63 20 53 53 4c 53 6f ..return.n;.+.}.+.+.public.SSLSo
5a80 63 6b 65 74 20 70 72 6f 78 79 5f 73 6f 63 6b 65 74 28 53 53 4c 53 6f 63 6b 65 74 46 61 63 74 6f cket.proxy_socket(SSLSocketFacto
5aa0 72 79 20 66 61 63 74 6f 72 79 29 20 7b 0a 2b 09 09 50 72 6f 70 65 72 74 69 65 73 20 70 72 6f 70 ry.factory).{.+..Properties.prop
5ac0 73 20 3d 20 6e 75 6c 6c 3b 0a 2b 09 09 53 74 72 69 6e 67 20 70 72 6f 78 79 48 6f 73 74 20 3d 20 s.=.null;.+..String.proxyHost.=.
5ae0 6e 75 6c 6c 3b 0a 2b 09 09 69 6e 74 20 70 72 6f 78 79 50 6f 72 74 20 3d 20 30 3b 0a 2b 09 09 53 null;.+..int.proxyPort.=.0;.+..S
5b00 74 72 69 6e 67 20 70 72 6f 78 79 48 6f 73 74 5f 6e 6f 73 73 6c 20 3d 20 6e 75 6c 6c 3b 0a 2b 09 tring.proxyHost_nossl.=.null;.+.
5b20 09 69 6e 74 20 70 72 6f 78 79 50 6f 72 74 5f 6e 6f 73 73 6c 20 3d 20 30 3b 0a 2b 09 09 53 74 72 .int.proxyPort_nossl.=.0;.+..Str
5b40 69 6e 67 20 73 74 72 3b 0a 2b 0a 2b 09 09 2f 2a 20 73 65 65 20 69 66 20 77 65 20 63 61 6e 20 67 ing.str;.+.+../*.see.if.we.can.g
5b60 75 65 73 73 20 74 68 65 20 70 72 6f 78 79 20 69 6e 66 6f 20 66 72 6f 6d 20 50 72 6f 70 65 72 74 uess.the.proxy.info.from.Propert
5b80 69 65 73 3a 20 2a 2f 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 70 72 6f 70 73 20 3d 20 53 79 73 ies:.*/.+..try.{.+...props.=.Sys
5ba0 74 65 6d 2e 67 65 74 50 72 6f 70 65 72 74 69 65 73 28 29 3b 0a 2b 09 09 7d 20 63 61 74 63 68 20 tem.getProperties();.+..}.catch.
5bc0 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 64 62 67 28 22 70 72 6f 70 73 20 66 (Exception.e).{.+...dbg("props.f
5be0 61 69 6c 65 64 3a 20 22 20 2b 20 65 2e 67 65 74 4d 65 73 73 61 67 65 28 29 29 3b 0a 2b 09 09 7d ailed:.".+.e.getMessage());.+..}
5c00 0a 2b 09 09 69 66 20 28 70 72 6f 70 73 20 21 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 64 62 67 .+..if.(props.!=.null).{.+...dbg
5c20 28 22 5c 6e 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 5c 6e 41 6c 6c 20 70 72 6f 70 73 3a 22 ("\n---------------\nAll.props:"
5c40 29 3b 0a 2b 09 09 09 70 72 6f 70 73 2e 6c 69 73 74 28 53 79 73 74 65 6d 2e 6f 75 74 29 3b 0a 2b );.+...props.list(System.out);.+
5c60 09 09 09 64 62 67 28 22 5c 6e 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 5c 6e 5c 6e 22 29 3b ...dbg("\n---------------\n\n");
5c80 0a 2b 0a 2b 09 09 09 66 6f 72 20 28 45 6e 75 6d 65 72 61 74 69 6f 6e 20 65 20 3d 20 70 72 6f 70 .+.+...for.(Enumeration.e.=.prop
5ca0 73 2e 70 72 6f 70 65 72 74 79 4e 61 6d 65 73 28 29 3b 20 65 2e 68 61 73 4d 6f 72 65 45 6c 65 6d s.propertyNames();.e.hasMoreElem
5cc0 65 6e 74 73 28 29 3b 20 29 20 7b 0a 2b 09 09 09 09 53 74 72 69 6e 67 20 73 20 3d 20 28 53 74 72 ents();.).{.+....String.s.=.(Str
5ce0 69 6e 67 29 20 65 2e 6e 65 78 74 45 6c 65 6d 65 6e 74 28 29 3b 0a 2b 09 09 09 09 53 74 72 69 6e ing).e.nextElement();.+....Strin
5d00 67 20 76 20 3d 20 53 79 73 74 65 6d 2e 67 65 74 50 72 6f 70 65 72 74 79 28 73 29 3b 0a 2b 09 09 g.v.=.System.getProperty(s);.+..
5d20 09 09 53 74 72 69 6e 67 20 73 32 20 3d 20 73 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 3b 0a 2b ..String.s2.=.s.toLowerCase();.+
5d40 09 09 09 09 53 74 72 69 6e 67 20 76 32 20 3d 20 76 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 3b ....String.v2.=.v.toLowerCase();
5d60 0a 2b 0a 2b 09 09 09 09 69 66 20 28 73 32 2e 69 6e 64 65 78 4f 66 28 22 70 72 6f 78 79 22 29 20 .+.+....if.(s2.indexOf("proxy").
5d80 3c 20 30 20 26 26 20 76 32 2e 69 6e 64 65 78 4f 66 28 22 70 72 6f 78 79 22 29 20 3c 20 30 29 20 <.0.&&.v2.indexOf("proxy").<.0).
5da0 7b 0a 2b 09 09 09 09 09 63 6f 6e 74 69 6e 75 65 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 {.+.....continue;.+....}.+....if
5dc0 20 28 76 32 2e 69 6e 64 65 78 4f 66 28 22 68 74 74 70 73 22 29 20 3c 20 30 29 20 7b 0a 2b 09 09 .(v2.indexOf("https").<.0).{.+..
5de0 09 09 09 63 6f 6e 74 69 6e 75 65 3b 0a 2b 09 09 09 09 7d 0a 2b 0a 2b 09 09 09 09 69 66 20 28 73 ...continue;.+....}.+.+....if.(s
5e00 32 2e 69 6e 64 65 78 4f 66 28 22 70 72 6f 78 79 2e 68 74 74 70 73 2e 68 6f 73 74 22 29 20 3e 3d 2.indexOf("proxy.https.host").>=
5e20 20 30 29 20 7b 0a 2b 09 09 09 09 09 70 72 6f 78 79 48 6f 73 74 20 3d 20 76 32 3b 0a 2b 09 09 09 .0).{.+.....proxyHost.=.v2;.+...
5e40 09 09 63 6f 6e 74 69 6e 75 65 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 28 73 32 2e 69 ..continue;.+....}.+....if.(s2.i
5e60 6e 64 65 78 4f 66 28 22 70 72 6f 78 79 2e 68 74 74 70 73 2e 70 6f 72 74 22 29 20 3e 3d 20 30 29 ndexOf("proxy.https.port").>=.0)
5e80 20 7b 0a 2b 09 09 09 09 09 70 72 6f 78 79 50 6f 72 74 20 3d 20 67 69 6e 74 28 76 32 29 3b 0a 2b .{.+.....proxyPort.=.gint(v2);.+
5ea0 09 09 09 09 09 63 6f 6e 74 69 6e 75 65 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 28 73 .....continue;.+....}.+....if.(s
5ec0 32 2e 69 6e 64 65 78 4f 66 28 22 70 72 6f 78 79 2e 68 74 74 70 2e 68 6f 73 74 22 29 20 3e 3d 20 2.indexOf("proxy.http.host").>=.
5ee0 30 29 20 7b 0a 2b 09 09 09 09 09 70 72 6f 78 79 48 6f 73 74 5f 6e 6f 73 73 6c 20 3d 20 76 32 3b 0).{.+.....proxyHost_nossl.=.v2;
5f00 0a 2b 09 09 09 09 09 63 6f 6e 74 69 6e 75 65 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 .+.....continue;.+....}.+....if.
5f20 28 73 32 2e 69 6e 64 65 78 4f 66 28 22 70 72 6f 78 79 2e 68 74 74 70 2e 70 6f 72 74 22 29 20 3e (s2.indexOf("proxy.http.port").>
5f40 3d 20 30 29 20 7b 0a 2b 09 09 09 09 09 70 72 6f 78 79 50 6f 72 74 5f 6e 6f 73 73 6c 20 3d 20 67 =.0).{.+.....proxyPort_nossl.=.g
5f60 69 6e 74 28 76 32 29 3b 0a 2b 09 09 09 09 09 63 6f 6e 74 69 6e 75 65 3b 0a 2b 09 09 09 09 7d 0a int(v2);.+.....continue;.+....}.
5f80 2b 0a 2b 09 09 09 09 53 74 72 69 6e 67 5b 5d 20 70 69 65 63 65 73 20 3d 20 76 2e 73 70 6c 69 74 +.+....String[].pieces.=.v.split
5fa0 28 22 5b 2c 3b 5d 22 29 3b 0a 2b 09 09 09 09 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 ("[,;]");.+....for.(int.i.=.0;.i
5fc0 20 3c 20 70 69 65 63 65 73 2e 6c 65 6e 67 74 68 3b 20 69 2b 2b 29 20 7b 0a 2b 09 09 09 09 09 53 .<.pieces.length;.i++).{.+.....S
5fe0 74 72 69 6e 67 20 70 20 3d 20 70 69 65 63 65 73 5b 69 5d 3b 0a 2b 09 09 09 09 09 69 6e 74 20 6a tring.p.=.pieces[i];.+.....int.j
6000 20 3d 20 70 2e 69 6e 64 65 78 4f 66 28 22 68 74 74 70 73 22 29 3b 0a 2b 09 09 09 09 09 69 66 20 .=.p.indexOf("https");.+.....if.
6020 28 6a 20 3c 20 30 29 20 7b 0a 2b 09 09 09 09 09 09 63 6f 6e 74 69 6e 75 65 3b 0a 2b 09 09 09 09 (j.<.0).{.+......continue;.+....
6040 09 7d 0a 2b 09 09 09 09 09 6a 20 3d 20 70 2e 69 6e 64 65 78 4f 66 28 22 3d 22 2c 20 6a 29 3b 0a .}.+.....j.=.p.indexOf("=",.j);.
6060 2b 09 09 09 09 09 69 66 20 28 6a 20 3c 20 30 29 20 7b 0a 2b 09 09 09 09 09 09 63 6f 6e 74 69 6e +.....if.(j.<.0).{.+......contin
6080 75 65 3b 0a 2b 09 09 09 09 09 7d 0a 2b 09 09 09 09 09 70 20 3d 20 70 2e 73 75 62 73 74 72 69 6e ue;.+.....}.+.....p.=.p.substrin
60a0 67 28 6a 2b 31 29 3b 0a 2b 09 09 09 09 09 53 74 72 69 6e 67 20 5b 5d 20 68 70 20 3d 20 70 2e 73 g(j+1);.+.....String.[].hp.=.p.s
60c0 70 6c 69 74 28 22 3a 22 29 3b 0a 2b 09 09 09 09 09 69 66 20 28 68 70 2e 6c 65 6e 67 74 68 20 21 plit(":");.+.....if.(hp.length.!
60e0 3d 20 32 29 20 7b 0a 2b 09 09 09 09 09 09 63 6f 6e 74 69 6e 75 65 3b 0a 2b 09 09 09 09 09 7d 0a =.2).{.+......continue;.+.....}.
6100 2b 09 09 09 09 09 69 66 20 28 68 70 5b 30 5d 2e 6c 65 6e 67 74 68 28 29 20 3e 20 31 20 26 26 20 +.....if.(hp[0].length().>.1.&&.
6120 68 70 5b 31 5d 2e 6c 65 6e 67 74 68 28 29 20 3e 20 31 29 20 7b 0a 2b 0a 2b 09 09 09 09 09 09 70 hp[1].length().>.1).{.+.+......p
6140 72 6f 78 79 50 6f 72 74 20 3d 20 67 69 6e 74 28 68 70 5b 31 5d 29 3b 0a 2b 09 09 09 09 09 09 69 roxyPort.=.gint(hp[1]);.+......i
6160 66 20 28 70 72 6f 78 79 50 6f 72 74 20 3c 20 30 29 20 7b 0a 2b 09 09 09 09 09 09 09 63 6f 6e 74 f.(proxyPort.<.0).{.+.......cont
6180 69 6e 75 65 3b 0a 2b 09 09 09 09 09 09 7d 0a 2b 09 09 09 09 09 09 70 72 6f 78 79 48 6f 73 74 20 inue;.+......}.+......proxyHost.
61a0 3d 20 6e 65 77 20 53 74 72 69 6e 67 28 68 70 5b 30 5d 29 3b 0a 2b 09 09 09 09 09 09 62 72 65 61 =.new.String(hp[0]);.+......brea
61c0 6b 3b 0a 2b 09 09 09 09 09 7d 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 7d 0a 2b 09 09 7d 0a 2b 09 09 k;.+.....}.+....}.+...}.+..}.+..
61e0 69 66 20 28 70 72 6f 78 79 48 6f 73 74 20 21 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 69 66 20 if.(proxyHost.!=.null).{.+...if.
6200 28 70 72 6f 78 79 48 6f 73 74 5f 6e 6f 73 73 6c 20 21 3d 20 6e 75 6c 6c 20 26 26 20 70 72 6f 78 (proxyHost_nossl.!=.null.&&.prox
6220 79 50 6f 72 74 5f 6e 6f 73 73 6c 20 3e 20 30 29 20 7b 0a 2b 09 09 09 09 64 62 67 28 22 55 73 69 yPort_nossl.>.0).{.+....dbg("Usi
6240 6e 67 20 68 74 74 70 20 70 72 6f 78 79 20 69 6e 66 6f 20 69 6e 73 74 65 61 64 20 6f 66 20 68 74 ng.http.proxy.info.instead.of.ht
6260 74 70 73 2e 22 29 3b 0a 2b 09 09 09 09 70 72 6f 78 79 48 6f 73 74 20 3d 20 70 72 6f 78 79 48 6f tps.");.+....proxyHost.=.proxyHo
6280 73 74 5f 6e 6f 73 73 6c 3b 0a 2b 09 09 09 09 70 72 6f 78 79 50 6f 72 74 20 3d 20 70 72 6f 78 79 st_nossl;.+....proxyPort.=.proxy
62a0 50 6f 72 74 5f 6e 6f 73 73 6c 3b 0a 2b 09 09 09 7d 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 69 66 20 28 Port_nossl;.+...}.+..}.+.+..if.(
62c0 70 72 6f 78 79 5f 69 6e 5f 75 73 65 29 20 7b 0a 2b 09 09 09 69 66 20 28 70 72 6f 78 79 5f 64 69 proxy_in_use).{.+...if.(proxy_di
62e0 61 6c 6f 67 5f 68 6f 73 74 20 21 3d 20 6e 75 6c 6c 20 26 26 20 70 72 6f 78 79 5f 64 69 61 6c 6f alog_host.!=.null.&&.proxy_dialo
6300 67 5f 70 6f 72 74 20 3e 20 30 29 20 7b 0a 2b 09 09 09 09 70 72 6f 78 79 48 6f 73 74 20 3d 20 70 g_port.>.0).{.+....proxyHost.=.p
6320 72 6f 78 79 5f 64 69 61 6c 6f 67 5f 68 6f 73 74 3b 0a 2b 09 09 09 09 70 72 6f 78 79 50 6f 72 74 roxy_dialog_host;.+....proxyPort
6340 20 3d 20 70 72 6f 78 79 5f 64 69 61 6c 6f 67 5f 70 6f 72 74 3b 0a 2b 09 09 09 7d 0a 2b 09 09 09 .=.proxy_dialog_port;.+...}.+...
6360 69 66 20 28 70 72 6f 78 79 48 6f 73 74 20 21 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 09 64 62 if.(proxyHost.!=.null).{.+....db
6380 67 28 22 4c 75 63 6b 79 20 75 73 21 20 77 65 20 66 69 67 75 72 65 64 20 6f 75 74 20 74 68 65 20 g("Lucky.us!.we.figured.out.the.
63a0 50 72 6f 78 79 20 70 61 72 61 6d 65 74 65 72 73 3a 20 22 20 2b 20 70 72 6f 78 79 48 6f 73 74 20 Proxy.parameters:.".+.proxyHost.
63c0 2b 20 22 20 22 20 2b 20 70 72 6f 78 79 50 6f 72 74 29 3b 0a 2b 09 09 09 7d 20 65 6c 73 65 20 7b +.".".+.proxyPort);.+...}.else.{
63e0 0a 2b 09 09 09 09 2f 2a 20 61 73 6b 20 75 73 65 72 20 74 6f 20 68 65 6c 70 20 75 73 3a 20 2a 2f .+..../*.ask.user.to.help.us:.*/
6400 0a 2b 09 09 09 09 50 72 6f 78 79 44 69 61 6c 6f 67 20 70 64 20 3d 20 6e 65 77 20 50 72 6f 78 79 .+....ProxyDialog.pd.=.new.Proxy
6420 44 69 61 6c 6f 67 28 70 72 6f 78 79 48 6f 73 74 2c 20 70 72 6f 78 79 50 6f 72 74 29 3b 0a 2b 09 Dialog(proxyHost,.proxyPort);.+.
6440 09 09 09 70 64 2e 71 75 65 72 79 55 73 65 72 28 29 3b 0a 2b 09 09 09 09 70 72 6f 78 79 48 6f 73 ...pd.queryUser();.+....proxyHos
6460 74 20 3d 20 70 64 2e 67 65 74 48 6f 73 74 28 29 3b 20 0a 2b 09 09 09 09 70 72 6f 78 79 50 6f 72 t.=.pd.getHost();..+....proxyPor
6480 74 20 3d 20 70 64 2e 67 65 74 50 6f 72 74 28 29 3b 0a 2b 09 09 09 09 70 72 6f 78 79 5f 64 69 61 t.=.pd.getPort();.+....proxy_dia
64a0 6c 6f 67 5f 68 6f 73 74 20 3d 20 6e 65 77 20 53 74 72 69 6e 67 28 70 72 6f 78 79 48 6f 73 74 29 log_host.=.new.String(proxyHost)
64c0 3b 0a 2b 09 09 09 09 70 72 6f 78 79 5f 64 69 61 6c 6f 67 5f 70 6f 72 74 20 3d 20 70 72 6f 78 79 ;.+....proxy_dialog_port.=.proxy
64e0 50 6f 72 74 3b 0a 2b 09 09 09 09 64 62 67 28 22 55 73 65 72 20 73 61 69 64 20 68 6f 73 74 3a 20 Port;.+....dbg("User.said.host:.
6500 22 20 2b 20 70 64 2e 67 65 74 48 6f 73 74 28 29 20 2b 20 22 20 70 6f 72 74 3a 20 22 20 2b 20 70 ".+.pd.getHost().+.".port:.".+.p
6520 64 2e 67 65 74 50 6f 72 74 28 29 29 3b 0a 2b 09 09 09 7d 0a 2b 0a 2b 09 09 09 64 62 67 28 22 70 d.getPort());.+...}.+.+...dbg("p
6540 72 6f 78 79 5f 69 6e 5f 75 73 65 20 70 73 6f 63 6b 65 74 3a 22 29 3b 0a 2b 09 09 09 70 72 6f 78 roxy_in_use.psocket:");.+...prox
6560 79 53 6f 63 6b 20 3d 20 70 73 6f 63 6b 65 74 28 70 72 6f 78 79 48 6f 73 74 2c 20 70 72 6f 78 79 ySock.=.psocket(proxyHost,.proxy
6580 50 6f 72 74 29 3b 0a 2b 09 09 09 69 66 20 28 70 72 6f 78 79 53 6f 63 6b 20 3d 3d 20 6e 75 6c 6c Port);.+...if.(proxySock.==.null
65a0 29 20 7b 0a 2b 09 09 09 09 64 62 67 28 22 31 2d 61 20 73 61 64 6c 79 2c 20 72 65 74 75 72 6e 69 ).{.+....dbg("1-a.sadly,.returni
65c0 6e 67 20 61 20 6e 75 6c 6c 20 73 6f 63 6b 65 74 22 29 3b 0a 2b 09 09 09 09 72 65 74 75 72 6e 20 ng.a.null.socket");.+....return.
65e0 6e 75 6c 6c 3b 0a 2b 09 09 09 7d 0a 2b 09 09 09 53 74 72 69 6e 67 20 68 70 20 3d 20 68 6f 73 74 null;.+...}.+...String.hp.=.host
6600 20 2b 20 22 3a 22 20 2b 20 70 6f 72 74 3b 0a 2b 0a 2b 09 09 09 53 74 72 69 6e 67 20 72 65 71 31 .+.":".+.port;.+.+...String.req1
6620 20 3d 20 22 43 4f 4e 4e 45 43 54 20 22 20 2b 20 68 70 20 2b 20 22 20 48 54 54 50 2f 31 2e 31 5c .=."CONNECT.".+.hp.+.".HTTP/1.1\
6640 72 5c 6e 22 0a 2b 09 09 09 20 20 20 20 2b 20 22 48 6f 73 74 3a 20 22 20 2b 20 68 70 20 2b 20 22 r\n".+.......+."Host:.".+.hp.+."
6660 5c 72 5c 6e 5c 72 5c 6e 22 3b 0a 2b 0a 2b 09 09 09 64 62 67 28 22 72 65 71 75 65 73 74 69 6e 67 \r\n\r\n";.+.+...dbg("requesting
6680 31 3a 20 22 20 2b 20 72 65 71 31 29 3b 0a 2b 0a 2b 09 09 09 74 72 79 20 7b 0a 2b 09 09 09 09 70 1:.".+.req1);.+.+...try.{.+....p
66a0 72 6f 78 79 5f 6f 73 2e 77 72 69 74 65 28 72 65 71 31 2e 67 65 74 42 79 74 65 73 28 29 29 3b 0a roxy_os.write(req1.getBytes());.
66c0 2b 09 09 09 09 53 74 72 69 6e 67 20 72 65 70 6c 79 20 3d 20 72 65 61 64 6c 69 6e 65 28 70 72 6f +....String.reply.=.readline(pro
66e0 78 79 5f 69 73 29 3b 0a 2b 0a 2b 09 09 09 09 64 62 67 28 22 70 72 6f 78 79 20 72 65 70 6c 69 65 xy_is);.+.+....dbg("proxy.replie
6700 64 31 3a 20 22 20 2b 20 72 65 70 6c 79 2e 74 72 69 6d 28 29 29 3b 0a 2b 0a 2b 09 09 09 09 69 66 d1:.".+.reply.trim());.+.+....if
6720 20 28 72 65 70 6c 79 2e 69 6e 64 65 78 4f 66 28 22 48 54 54 50 2f 31 2e 22 29 20 3c 20 30 20 26 .(reply.indexOf("HTTP/1.").<.0.&
6740 26 20 72 65 70 6c 79 2e 69 6e 64 65 78 4f 66 28 22 20 32 30 30 22 29 20 3c 20 30 29 20 7b 0a 2b &.reply.indexOf(".200").<.0).{.+
6760 09 09 09 09 09 70 72 6f 78 79 53 6f 63 6b 2e 63 6c 6f 73 65 28 29 3b 0a 2b 09 09 09 09 09 70 72 .....proxySock.close();.+.....pr
6780 6f 78 79 53 6f 63 6b 20 3d 20 70 73 6f 63 6b 65 74 28 70 72 6f 78 79 48 6f 73 74 2c 20 70 72 6f oxySock.=.psocket(proxyHost,.pro
67a0 78 79 50 6f 72 74 29 3b 0a 2b 09 09 09 09 09 69 66 20 28 70 72 6f 78 79 53 6f 63 6b 20 3d 3d 20 xyPort);.+.....if.(proxySock.==.
67c0 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 09 09 09 64 62 67 28 22 32 2d 61 20 73 61 64 6c 79 2c 20 72 null).{.+......dbg("2-a.sadly,.r
67e0 65 74 75 72 6e 69 6e 67 20 61 20 6e 75 6c 6c 20 73 6f 63 6b 65 74 22 29 3b 0a 2b 09 09 09 09 09 eturning.a.null.socket");.+.....
6800 09 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 2b 09 09 09 09 09 7d 0a 2b 09 09 09 09 7d 0a 2b 09 09 .return.null;.+.....}.+....}.+..
6820 09 7d 20 63 61 74 63 68 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 09 64 62 67 .}.catch(Exception.e).{.+....dbg
6840 28 22 73 6f 63 6b 20 70 72 6f 62 31 3a 20 22 20 2b 20 65 2e 67 65 74 4d 65 73 73 61 67 65 28 29 ("sock.prob1:.".+.e.getMessage()
6860 29 3b 0a 2b 09 09 09 7d 0a 2b 0a 2b 09 09 09 77 68 69 6c 65 20 28 74 72 75 65 29 20 7b 0a 2b 09 );.+...}.+.+...while.(true).{.+.
6880 09 09 09 53 74 72 69 6e 67 20 6c 69 6e 65 20 3d 20 72 65 61 64 6c 69 6e 65 28 70 72 6f 78 79 5f ...String.line.=.readline(proxy_
68a0 69 73 29 3b 0a 2b 09 09 09 09 64 62 67 28 22 70 72 6f 78 79 20 6c 69 6e 65 31 3a 20 22 20 2b 20 is);.+....dbg("proxy.line1:.".+.
68c0 6c 69 6e 65 2e 74 72 69 6d 28 29 29 3b 0a 2b 09 09 09 09 69 66 20 28 6c 69 6e 65 2e 65 71 75 61 line.trim());.+....if.(line.equa
68e0 6c 73 28 22 5c 72 5c 6e 22 29 20 7c 7c 20 6c 69 6e 65 2e 65 71 75 61 6c 73 28 22 5c 6e 22 29 29 ls("\r\n").||.line.equals("\n"))
6900 20 7b 0a 2b 09 09 09 09 09 62 72 65 61 6b 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 7d 0a 2b 09 09 .{.+.....break;.+....}.+...}.+..
6920 7d 20 65 6c 73 65 20 69 66 20 28 76 69 65 77 65 72 2e 43 4f 4e 4e 45 43 54 20 21 3d 20 6e 75 6c }.else.if.(viewer.CONNECT.!=.nul
6940 6c 29 20 7b 0a 2b 09 09 09 64 62 67 28 22 76 69 65 77 65 72 2e 43 4f 4e 4e 45 43 54 20 70 73 6f l).{.+...dbg("viewer.CONNECT.pso
6960 63 6b 65 74 3a 22 29 3b 0a 2b 09 09 09 70 72 6f 78 79 53 6f 63 6b 20 3d 20 70 73 6f 63 6b 65 74 cket:");.+...proxySock.=.psocket
6980 28 68 6f 73 74 2c 20 70 6f 72 74 29 3b 0a 2b 09 09 09 69 66 20 28 70 72 6f 78 79 53 6f 63 6b 20 (host,.port);.+...if.(proxySock.
69a0 3d 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 09 64 62 67 28 22 31 2d 62 20 73 61 64 6c 79 2c 20 ==.null).{.+....dbg("1-b.sadly,.
69c0 72 65 74 75 72 6e 69 6e 67 20 61 20 6e 75 6c 6c 20 73 6f 63 6b 65 74 22 29 3b 0a 2b 09 09 09 09 returning.a.null.socket");.+....
69e0 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 2b 09 09 09 7d 0a 2b 09 09 7d 0a 2b 09 09 0a 2b 09 09 69 return.null;.+...}.+..}.+...+..i
6a00 66 20 28 76 69 65 77 65 72 2e 43 4f 4e 4e 45 43 54 20 21 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 f.(viewer.CONNECT.!=.null).{.+..
6a20 09 53 74 72 69 6e 67 20 68 70 20 3d 20 76 69 65 77 65 72 2e 43 4f 4e 4e 45 43 54 3b 0a 2b 09 09 .String.hp.=.viewer.CONNECT;.+..
6a40 09 53 74 72 69 6e 67 20 72 65 71 32 20 3d 20 22 43 4f 4e 4e 45 43 54 20 22 20 2b 20 68 70 20 2b .String.req2.=."CONNECT.".+.hp.+
6a60 20 22 20 48 54 54 50 2f 31 2e 31 5c 72 5c 6e 22 0a 2b 09 09 09 20 20 20 20 2b 20 22 48 6f 73 74 .".HTTP/1.1\r\n".+.......+."Host
6a80 3a 20 22 20 2b 20 68 70 20 2b 20 22 5c 72 5c 6e 5c 72 5c 6e 22 3b 0a 2b 0a 2b 09 09 09 64 62 67 :.".+.hp.+."\r\n\r\n";.+.+...dbg
6aa0 28 22 72 65 71 75 65 73 74 69 6e 67 32 3a 20 22 20 2b 20 72 65 71 32 29 3b 0a 2b 0a 2b 09 09 09 ("requesting2:.".+.req2);.+.+...
6ac0 74 72 79 20 7b 0a 2b 09 09 09 09 70 72 6f 78 79 5f 6f 73 2e 77 72 69 74 65 28 72 65 71 32 2e 67 try.{.+....proxy_os.write(req2.g
6ae0 65 74 42 79 74 65 73 28 29 29 3b 0a 2b 09 09 09 09 53 74 72 69 6e 67 20 72 65 70 6c 79 20 3d 20 etBytes());.+....String.reply.=.
6b00 72 65 61 64 6c 69 6e 65 28 70 72 6f 78 79 5f 69 73 29 3b 0a 2b 0a 2b 09 09 09 09 64 62 67 28 22 readline(proxy_is);.+.+....dbg("
6b20 70 72 6f 78 79 20 72 65 70 6c 69 65 64 32 3a 20 22 20 2b 20 72 65 70 6c 79 2e 74 72 69 6d 28 29 proxy.replied2:.".+.reply.trim()
6b40 29 3b 0a 2b 0a 2b 09 09 09 09 69 66 20 28 72 65 70 6c 79 2e 69 6e 64 65 78 4f 66 28 22 48 54 54 );.+.+....if.(reply.indexOf("HTT
6b60 50 2f 31 2e 22 29 20 3c 20 30 20 26 26 20 72 65 70 6c 79 2e 69 6e 64 65 78 4f 66 28 22 20 32 30 P/1.").<.0.&&.reply.indexOf(".20
6b80 30 22 29 20 3c 20 30 29 20 7b 0a 2b 09 09 09 09 09 70 72 6f 78 79 53 6f 63 6b 2e 63 6c 6f 73 65 0").<.0).{.+.....proxySock.close
6ba0 28 29 3b 0a 2b 09 09 09 09 09 70 72 6f 78 79 53 6f 63 6b 20 3d 20 70 73 6f 63 6b 65 74 28 70 72 ();.+.....proxySock.=.psocket(pr
6bc0 6f 78 79 48 6f 73 74 2c 20 70 72 6f 78 79 50 6f 72 74 29 3b 0a 2b 09 09 09 09 09 69 66 20 28 70 oxyHost,.proxyPort);.+.....if.(p
6be0 72 6f 78 79 53 6f 63 6b 20 3d 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 09 09 09 09 09 09 64 62 67 28 22 roxySock.==.null).{.+......dbg("
6c00 32 2d 62 20 73 61 64 6c 79 2c 20 72 65 74 75 72 6e 69 6e 67 20 61 20 6e 75 6c 6c 20 73 6f 63 6b 2-b.sadly,.returning.a.null.sock
6c20 65 74 22 29 3b 0a 2b 09 09 09 09 09 09 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 2b 09 09 09 09 09 et");.+......return.null;.+.....
6c40 7d 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 7d 20 63 61 74 63 68 28 45 78 63 65 70 74 69 6f 6e 20 65 }.+....}.+...}.catch(Exception.e
6c60 29 20 7b 0a 2b 09 09 09 09 64 62 67 28 22 73 6f 63 6b 20 70 72 6f 62 32 3a 20 22 20 2b 20 65 2e ).{.+....dbg("sock.prob2:.".+.e.
6c80 67 65 74 4d 65 73 73 61 67 65 28 29 29 3b 0a 2b 09 09 09 7d 0a 2b 0a 2b 09 09 09 77 68 69 6c 65 getMessage());.+...}.+.+...while
6ca0 20 28 74 72 75 65 29 20 7b 0a 2b 09 09 09 09 53 74 72 69 6e 67 20 6c 69 6e 65 20 3d 20 72 65 61 .(true).{.+....String.line.=.rea
6cc0 64 6c 69 6e 65 28 70 72 6f 78 79 5f 69 73 29 3b 0a 2b 09 09 09 09 64 62 67 28 22 70 72 6f 78 79 dline(proxy_is);.+....dbg("proxy
6ce0 20 6c 69 6e 65 32 3a 20 22 20 2b 20 6c 69 6e 65 2e 74 72 69 6d 28 29 29 3b 0a 2b 09 09 09 09 69 .line2:.".+.line.trim());.+....i
6d00 66 20 28 6c 69 6e 65 2e 65 71 75 61 6c 73 28 22 5c 72 5c 6e 22 29 20 7c 7c 20 6c 69 6e 65 2e 65 f.(line.equals("\r\n").||.line.e
6d20 71 75 61 6c 73 28 22 5c 6e 22 29 29 20 7b 0a 2b 09 09 09 09 09 62 72 65 61 6b 3b 0a 2b 09 09 09 quals("\n")).{.+.....break;.+...
6d40 09 7d 0a 2b 09 09 09 7d 0a 2b 09 09 09 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 53 6f 63 6b 65 74 20 73 .}.+...}.+....+..}.+.+..Socket.s
6d60 73 6c 73 6f 63 6b 20 3d 20 6e 75 6c 6c 3b 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 73 73 6c 73 slsock.=.null;.+..try.{.+...ssls
6d80 6f 63 6b 20 3d 20 66 61 63 74 6f 72 79 2e 63 72 65 61 74 65 53 6f 63 6b 65 74 28 70 72 6f 78 79 ock.=.factory.createSocket(proxy
6da0 53 6f 63 6b 2c 20 68 6f 73 74 2c 20 70 6f 72 74 2c 20 74 72 75 65 29 3b 0a 2b 09 09 7d 20 63 61 Sock,.host,.port,.true);.+..}.ca
6dc0 74 63 68 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 64 62 67 28 22 73 73 6c 73 tch(Exception.e).{.+...dbg("ssls
6de0 6f 63 6b 20 70 72 6f 62 3a 20 22 20 2b 20 65 2e 67 65 74 4d 65 73 73 61 67 65 28 29 29 3b 0a 2b ock.prob:.".+.e.getMessage());.+
6e00 09 09 09 64 62 67 28 22 33 20 73 61 64 6c 79 2c 20 72 65 74 75 72 6e 69 6e 67 20 61 20 6e 75 6c ...dbg("3.sadly,.returning.a.nul
6e20 6c 20 73 6f 63 6b 65 74 22 29 3b 0a 2b 09 09 7d 0a 2b 0a 2b 09 09 72 65 74 75 72 6e 20 28 53 53 l.socket");.+..}.+.+..return.(SS
6e40 4c 53 6f 63 6b 65 74 29 20 73 73 6c 73 6f 63 6b 3b 0a 2b 09 7d 0a 2b 0a 2b 09 53 6f 63 6b 65 74 LSocket).sslsock;.+.}.+.+.Socket
6e60 20 70 73 6f 63 6b 65 74 28 53 74 72 69 6e 67 20 68 2c 20 69 6e 74 20 70 29 20 7b 0a 2b 09 09 53 .psocket(String.h,.int.p).{.+..S
6e80 6f 63 6b 65 74 20 70 73 6f 63 6b 20 3d 20 6e 75 6c 6c 3b 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 ocket.psock.=.null;.+..try.{.+..
6ea0 09 70 73 6f 63 6b 20 3d 20 6e 65 77 20 53 6f 63 6b 65 74 28 68 2c 20 70 29 3b 0a 2b 09 09 09 70 .psock.=.new.Socket(h,.p);.+...p
6ec0 72 6f 78 79 5f 69 73 20 3d 20 6e 65 77 20 44 61 74 61 49 6e 70 75 74 53 74 72 65 61 6d 28 6e 65 roxy_is.=.new.DataInputStream(ne
6ee0 77 20 42 75 66 66 65 72 65 64 49 6e 70 75 74 53 74 72 65 61 6d 28 0a 2b 09 09 09 20 20 20 20 70 w.BufferedInputStream(.+.......p
6f00 73 6f 63 6b 2e 67 65 74 49 6e 70 75 74 53 74 72 65 61 6d 28 29 2c 20 31 36 33 38 34 29 29 3b 0a sock.getInputStream(),.16384));.
6f20 2b 09 09 09 70 72 6f 78 79 5f 6f 73 20 3d 20 70 73 6f 63 6b 2e 67 65 74 4f 75 74 70 75 74 53 74 +...proxy_os.=.psock.getOutputSt
6f40 72 65 61 6d 28 29 3b 0a 2b 09 09 7d 20 63 61 74 63 68 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 ream();.+..}.catch(Exception.e).
6f60 7b 0a 2b 09 09 09 64 62 67 28 22 70 73 6f 63 6b 65 74 20 70 72 6f 62 3a 20 22 20 2b 20 65 2e 67 {.+...dbg("psocket.prob:.".+.e.g
6f80 65 74 4d 65 73 73 61 67 65 28 29 29 3b 0a 2b 09 09 09 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 2b etMessage());.+...return.null;.+
6fa0 09 09 7d 0a 2b 0a 2b 09 09 72 65 74 75 72 6e 20 70 73 6f 63 6b 3b 0a 2b 09 7d 0a 2b 0a 2b 09 53 ..}.+.+..return.psock;.+.}.+.+.S
6fc0 74 72 69 6e 67 20 72 65 61 64 6c 69 6e 65 28 44 61 74 61 49 6e 70 75 74 53 74 72 65 61 6d 20 69 tring.readline(DataInputStream.i
6fe0 29 20 7b 0a 2b 09 09 62 79 74 65 5b 5d 20 62 61 20 3d 20 6e 65 77 20 62 79 74 65 5b 31 5d 3b 0a ).{.+..byte[].ba.=.new.byte[1];.
7000 2b 09 09 53 74 72 69 6e 67 20 73 20 3d 20 6e 65 77 20 53 74 72 69 6e 67 28 22 22 29 3b 0a 2b 09 +..String.s.=.new.String("");.+.
7020 09 62 61 5b 30 5d 20 3d 20 30 3b 0a 2b 09 09 74 72 79 20 7b 0a 2b 09 09 09 77 68 69 6c 65 20 28 .ba[0].=.0;.+..try.{.+...while.(
7040 62 61 5b 30 5d 20 21 3d 20 30 78 61 29 20 7b 0a 2b 09 09 09 09 62 61 5b 30 5d 20 3d 20 28 62 79 ba[0].!=.0xa).{.+....ba[0].=.(by
7060 74 65 29 20 69 2e 72 65 61 64 55 6e 73 69 67 6e 65 64 42 79 74 65 28 29 3b 0a 2b 09 09 09 09 73 te).i.readUnsignedByte();.+....s
7080 20 2b 3d 20 6e 65 77 20 53 74 72 69 6e 67 28 62 61 29 3b 0a 2b 09 09 09 7d 0a 2b 09 09 7d 20 63 .+=.new.String(ba);.+...}.+..}.c
70a0 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 3b 0a 2b 09 09 7d 0a atch.(Exception.e).{.+...;.+..}.
70c0 2b 09 09 72 65 74 75 72 6e 20 73 3b 0a 2b 09 7d 0a 2b 7d 0a 2b 0a 2b 63 6c 61 73 73 20 54 72 75 +..return.s;.+.}.+}.+.+class.Tru
70e0 73 74 44 69 61 6c 6f 67 20 69 6d 70 6c 65 6d 65 6e 74 73 20 41 63 74 69 6f 6e 4c 69 73 74 65 6e stDialog.implements.ActionListen
7100 65 72 20 7b 0a 2b 09 53 74 72 69 6e 67 20 6d 73 67 2c 20 68 6f 73 74 2c 20 74 65 78 74 3b 0a 2b er.{.+.String.msg,.host,.text;.+
7120 09 69 6e 74 20 70 6f 72 74 3b 0a 2b 09 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e .int.port;.+.java.security.cert.
7140 43 65 72 74 69 66 69 63 61 74 65 5b 5d 20 74 72 75 73 74 61 6c 6c 43 65 72 74 73 20 3d 20 6e 75 Certificate[].trustallCerts.=.nu
7160 6c 6c 3b 0a 2b 09 62 6f 6f 6c 65 61 6e 20 76 69 65 77 69 6e 67 5f 63 65 72 74 20 3d 20 66 61 6c ll;.+.boolean.viewing_cert.=.fal
7180 73 65 3b 0a 2b 09 62 6f 6f 6c 65 61 6e 20 74 72 75 73 74 5f 74 68 69 73 5f 73 65 73 73 69 6f 6e se;.+.boolean.trust_this_session
71a0 20 3d 20 66 61 6c 73 65 3b 0a 2b 0a 2b 09 2f 2a 0a 2b 09 20 2a 20 74 68 69 73 20 69 73 20 74 68 .=.false;.+.+./*.+..*.this.is.th
71c0 65 20 67 75 69 20 74 6f 20 73 68 6f 77 20 74 68 65 20 75 73 65 72 20 74 68 65 20 63 65 72 74 20 e.gui.to.show.the.user.the.cert.
71e0 61 6e 64 20 69 6e 66 6f 20 61 6e 64 20 61 73 6b 0a 2b 09 20 2a 20 74 68 65 6d 20 69 66 20 74 68 and.info.and.ask.+..*.them.if.th
7200 65 79 20 77 61 6e 74 20 74 6f 20 63 6f 6e 74 69 6e 75 65 20 75 73 69 6e 67 20 74 68 69 73 20 63 ey.want.to.continue.using.this.c
7220 65 72 74 2e 0a 2b 09 20 2a 2f 0a 2b 0a 2b 09 42 75 74 74 6f 6e 20 6f 6b 2c 20 63 61 6e 63 65 6c ert..+..*/.+.+.Button.ok,.cancel
7240 2c 20 76 69 65 77 63 65 72 74 3b 0a 2b 09 54 65 78 74 41 72 65 61 20 74 65 78 74 61 72 65 61 3b ,.viewcert;.+.TextArea.textarea;
7260 0a 2b 09 43 68 65 63 6b 62 6f 78 20 61 63 63 65 70 74 2c 20 64 65 6e 79 3b 0a 2b 09 44 69 61 6c .+.Checkbox.accept,.deny;.+.Dial
7280 6f 67 20 64 69 61 6c 6f 67 3b 0a 2b 0a 2b 09 53 74 72 69 6e 67 20 73 31 20 3d 20 22 41 63 63 65 og.dialog;.+.+.String.s1.=."Acce
72a0 70 74 20 74 68 69 73 20 63 65 72 74 69 66 69 63 61 74 65 20 74 65 6d 70 6f 72 61 72 69 6c 79 20 pt.this.certificate.temporarily.
72c0 66 6f 72 20 74 68 69 73 20 73 65 73 73 69 6f 6e 22 3b 0a 2b 09 53 74 72 69 6e 67 20 73 32 20 3d for.this.session";.+.String.s2.=
72e0 20 22 44 6f 20 6e 6f 74 20 61 63 63 65 70 74 20 74 68 69 73 20 63 65 72 74 69 66 69 63 61 74 65 ."Do.not.accept.this.certificate
7300 20 61 6e 64 20 64 6f 20 6e 6f 74 20 63 6f 6e 6e 65 63 74 20 74 6f 22 0a 2b 09 20 20 20 20 2b 20 .and.do.not.connect.to".+.....+.
7320 22 20 74 68 69 73 20 56 4e 43 20 73 65 72 76 65 72 22 3b 0a 2b 09 53 74 72 69 6e 67 20 6c 6e 20 ".this.VNC.server";.+.String.ln.
7340 3d 20 22 5c 6e 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d =."\n---------------------------
7360 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 5c 6e 5c 6e 22 3b 0a 2b ------------------------\n\n";.+
7380 09 09 0a 2b 09 54 72 75 73 74 44 69 61 6c 6f 67 20 28 53 74 72 69 6e 67 20 68 2c 20 69 6e 74 20 ...+.TrustDialog.(String.h,.int.
73a0 70 2c 20 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 43 65 72 74 69 66 69 63 61 74 p,.java.security.cert.Certificat
73c0 65 5b 5d 20 73 29 20 7b 0a 2b 09 09 68 6f 73 74 20 3d 20 68 3b 0a 2b 09 09 70 6f 72 74 20 3d 20 e[].s).{.+..host.=.h;.+..port.=.
73e0 70 3b 0a 2b 09 09 74 72 75 73 74 61 6c 6c 43 65 72 74 73 20 3d 20 73 3b 0a 2b 0a 2b 09 09 6d 73 p;.+..trustallCerts.=.s;.+.+..ms
7400 67 20 3d 20 22 56 4e 43 20 53 65 72 76 65 72 20 22 20 2b 20 68 6f 73 74 20 2b 20 22 3a 22 20 2b g.=."VNC.Server.".+.host.+.":".+
7420 20 70 6f 72 74 20 2b 20 22 20 4e 6f 74 20 56 65 72 69 66 69 65 64 22 3b 0a 2b 09 7d 0a 2b 0a 2b .port.+.".Not.Verified";.+.}.+.+
7440 09 70 75 62 6c 69 63 20 62 6f 6f 6c 65 61 6e 20 71 75 65 72 79 55 73 65 72 28 29 20 7b 0a 2b 0a .public.boolean.queryUser().{.+.
7460 2b 09 09 2f 2a 20 63 72 65 61 74 65 20 61 6e 64 20 64 69 73 70 6c 61 79 20 74 68 65 20 64 69 61 +../*.create.and.display.the.dia
7480 6c 6f 67 20 66 6f 72 20 75 6e 76 65 72 69 66 69 65 64 20 63 65 72 74 2e 20 2a 2f 0a 2b 0a 2b 09 log.for.unverified.cert..*/.+.+.
74a0 09 46 72 61 6d 65 20 66 72 61 6d 65 20 3d 20 6e 65 77 20 46 72 61 6d 65 28 6d 73 67 29 3b 0a 2b .Frame.frame.=.new.Frame(msg);.+
74c0 0a 2b 09 09 64 69 61 6c 6f 67 20 3d 20 6e 65 77 20 44 69 61 6c 6f 67 28 66 72 61 6d 65 2c 20 74 .+..dialog.=.new.Dialog(frame,.t
74e0 72 75 65 29 3b 0a 2b 0a 2b 09 09 53 74 72 69 6e 67 20 69 6e 66 6f 73 74 72 20 3d 20 22 22 3b 0a rue);.+.+..String.infostr.=."";.
7500 2b 09 09 69 66 20 28 74 72 75 73 74 61 6c 6c 43 65 72 74 73 2e 6c 65 6e 67 74 68 20 3d 3d 20 31 +..if.(trustallCerts.length.==.1
7520 29 20 7b 0a 2b 09 09 09 43 65 72 74 49 6e 66 6f 20 63 69 20 3d 20 6e 65 77 20 43 65 72 74 49 6e ).{.+...CertInfo.ci.=.new.CertIn
7540 66 6f 28 74 72 75 73 74 61 6c 6c 43 65 72 74 73 5b 30 5d 29 3b 0a 2b 09 09 09 69 6e 66 6f 73 74 fo(trustallCerts[0]);.+...infost
7560 72 20 3d 20 63 69 2e 67 65 74 5f 63 65 72 74 69 6e 66 6f 28 22 61 6c 6c 22 29 3b 0a 2b 09 09 7d r.=.ci.get_certinfo("all");.+..}
7580 0a 2b 0a 2b 09 09 74 65 78 74 20 3d 20 22 5c 6e 22 20 0a 2b 2b 20 22 55 6e 61 62 6c 65 20 74 6f .+.+..text.=."\n"..++."Unable.to
75a0 20 76 65 72 69 66 79 20 74 68 65 20 69 64 65 6e 74 69 74 79 20 6f 66 5c 6e 22 0a 2b 2b 20 22 5c .verify.the.identity.of\n".++."\
75c0 6e 22 0a 2b 2b 20 22 20 20 20 20 20 20 20 20 22 20 2b 20 68 6f 73 74 20 2b 20 22 3a 22 20 2b 20 n".++."........".+.host.+.":".+.
75e0 70 6f 72 74 20 2b 20 22 5c 6e 22 20 0a 2b 2b 20 22 5c 6e 22 0a 2b 2b 20 69 6e 66 6f 73 74 72 0a port.+."\n"..++."\n".++.infostr.
7600 2b 2b 20 22 5c 6e 22 0a 2b 2b 20 22 61 73 20 61 20 74 72 75 73 74 65 64 20 56 4e 43 20 73 65 72 ++."\n".++."as.a.trusted.VNC.ser
7620 76 65 72 2e 5c 6e 22 0a 2b 2b 20 22 5c 6e 22 0a 2b 2b 20 22 54 68 69 73 20 6d 61 79 20 62 65 20 ver.\n".++."\n".++."This.may.be.
7640 64 75 65 20 74 6f 3a 5c 6e 22 0a 2b 2b 20 22 5c 6e 22 0a 2b 2b 20 22 20 2d 20 59 6f 75 72 20 72 due.to:\n".++."\n".++.".-.Your.r
7660 65 71 75 65 73 74 69 6e 67 20 74 6f 20 56 69 65 77 20 74 68 65 20 43 65 72 74 69 66 69 63 61 74 equesting.to.View.the.Certificat
7680 65 20 62 65 66 6f 72 65 20 61 63 63 65 70 74 69 6e 67 2e 5c 6e 22 0a 2b 2b 20 22 5c 6e 22 0a 2b e.before.accepting.\n".++."\n".+
76a0 2b 20 22 20 2d 20 54 68 65 20 56 4e 43 20 73 65 72 76 65 72 20 75 73 69 6e 67 20 61 20 53 65 6c +.".-.The.VNC.server.using.a.Sel
76c0 66 2d 53 69 67 6e 65 64 20 43 65 72 74 69 66 69 63 61 74 65 2e 5c 6e 22 0a 2b 2b 20 22 5c 6e 22 f-Signed.Certificate.\n".++."\n"
76e0 0a 2b 2b 20 22 20 2d 20 54 68 65 20 56 4e 43 20 73 65 72 76 65 72 20 75 73 69 6e 67 20 61 20 43 .++.".-.The.VNC.server.using.a.C
7700 65 72 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 79 20 6e 6f 74 20 72 65 63 6f 67 6e 69 ertificate.Authority.not.recogni
7720 7a 65 64 20 62 79 20 79 6f 75 72 5c 6e 22 0a 2b 2b 20 22 20 20 20 42 72 6f 77 73 65 72 20 6f 72 zed.by.your\n".++."...Browser.or
7740 20 4a 61 76 61 20 50 6c 75 67 69 6e 20 72 75 6e 74 69 6d 65 2e 5c 6e 22 0a 2b 2b 20 22 5c 6e 22 .Java.Plugin.runtime.\n".++."\n"
7760 0a 2b 2b 20 22 20 2d 20 54 68 65 20 75 73 65 20 6f 66 20 61 6e 20 41 70 61 63 68 65 20 53 53 4c .++.".-.The.use.of.an.Apache.SSL
7780 20 70 6f 72 74 61 6c 20 65 6d 70 6c 6f 79 69 6e 67 20 43 4f 4e 4e 45 43 54 20 70 72 6f 78 79 69 .portal.employing.CONNECT.proxyi
77a0 6e 67 20 61 6e 64 20 74 68 65 5c 6e 22 0a 2b 2b 20 22 20 20 20 41 70 61 63 68 65 20 77 65 62 20 ng.and.the\n".++."...Apache.web.
77c0 73 65 72 76 65 72 20 68 61 73 20 61 20 63 65 72 74 69 66 69 63 61 74 65 20 64 69 66 66 65 72 65 server.has.a.certificate.differe
77e0 6e 74 20 66 72 6f 6d 20 74 68 65 20 56 4e 43 20 73 65 72 76 65 72 27 73 2e 20 5c 6e 22 0a 2b 2b nt.from.the.VNC.server's..\n".++
7800 20 22 5c 6e 22 0a 2b 2b 20 22 20 2d 20 41 20 4d 61 6e 2d 49 6e 2d 54 68 65 2d 4d 69 64 64 6c 65 ."\n".++.".-.A.Man-In-The-Middle
7820 20 61 74 74 61 63 6b 20 69 6d 70 65 72 73 6f 6e 61 74 69 6e 67 20 61 73 20 74 68 65 20 56 4e 43 .attack.impersonating.as.the.VNC
7840 20 73 65 72 76 65 72 20 79 6f 75 20 77 69 73 68 5c 6e 22 0a 2b 2b 20 22 20 20 20 74 6f 20 63 6f .server.you.wish\n".++."...to.co
7860 6e 6e 65 63 74 20 74 6f 2e 20 20 28 57 6f 75 6c 64 6e 27 74 20 74 68 61 74 20 62 65 20 65 78 63 nnect.to...(Wouldn't.that.be.exc
7880 69 74 69 6e 67 21 21 29 5c 6e 22 0a 2b 2b 20 22 5c 6e 22 0a 2b 2b 20 22 42 79 20 73 61 66 65 6c iting!!)\n".++."\n".++."By.safel
78a0 79 20 63 6f 70 79 69 6e 67 20 74 68 65 20 56 4e 43 20 73 65 72 76 65 72 27 73 20 43 65 72 74 69 y.copying.the.VNC.server's.Certi
78c0 66 69 63 61 74 65 20 28 6f 72 20 75 73 69 6e 67 20 61 20 63 6f 6d 6d 6f 6e 5c 6e 22 0a 2b 2b 20 ficate.(or.using.a.common\n".++.
78e0 22 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 79 20 63 65 72 74 69 66 69 63 61 "Certificate.Authority.certifica
7900 74 65 29 20 79 6f 75 20 63 61 6e 20 63 6f 6e 66 69 67 75 72 65 20 79 6f 75 72 20 57 65 62 20 42 te).you.can.configure.your.Web.B
7920 72 6f 77 73 65 72 20 6f 72 5c 6e 22 0a 2b 2b 20 22 4a 61 76 61 20 50 6c 75 67 69 6e 20 74 6f 20 rowser.or\n".++."Java.Plugin.to.
7940 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 61 75 74 68 65 6e 74 69 63 61 74 65 20 74 68 69 73 20 automatically.authenticate.this.
7960 53 65 72 76 65 72 2e 5c 6e 22 0a 2b 2b 20 22 5c 6e 22 0a 2b 2b 20 22 49 66 20 79 6f 75 20 64 6f Server.\n".++."\n".++."If.you.do
7980 20 73 6f 2c 20 74 68 65 6e 20 79 6f 75 20 77 69 6c 6c 20 6f 6e 6c 79 20 68 61 76 65 20 74 6f 20 .so,.then.you.will.only.have.to.
79a0 63 6c 69 63 6b 20 5c 22 59 65 73 5c 22 20 77 68 65 6e 20 74 68 69 73 20 56 4e 43 5c 6e 22 0a 2b click.\"Yes\".when.this.VNC\n".+
79c0 2b 20 22 56 69 65 77 65 72 20 61 70 70 6c 65 74 20 61 73 6b 73 20 79 6f 75 20 77 68 65 74 68 65 +."Viewer.applet.asks.you.whethe
79e0 72 20 74 6f 20 74 72 75 73 74 20 79 6f 75 72 20 42 72 6f 77 73 65 72 2f 4a 61 76 61 20 50 6c 75 r.to.trust.your.Browser/Java.Plu
7a00 67 69 6e 27 73 5c 6e 22 0a 2b 2b 20 22 61 63 63 65 70 74 61 6e 63 65 20 6f 66 20 74 68 65 20 63 gin's\n".++."acceptance.of.the.c
7a20 65 72 74 69 66 69 63 61 74 65 2e 20 28 65 78 63 65 70 74 20 66 6f 72 20 74 68 65 20 41 70 61 63 ertificate..(except.for.the.Apac
7a40 68 65 20 70 6f 72 74 61 6c 20 63 61 73 65 20 61 62 6f 76 65 2e 29 5c 6e 22 0a 2b 3b 0a 2b 0a 2b he.portal.case.above.)\n".+;.+.+
7a60 09 09 2f 2a 20 74 68 65 20 61 63 63 65 70 74 20 2f 20 64 6f 2d 6e 6f 74 2d 61 63 63 65 70 74 20 ../*.the.accept./.do-not-accept.
7a80 72 61 64 69 6f 20 62 75 74 74 6f 6e 73 3a 20 2a 2f 0a 2b 09 09 43 68 65 63 6b 62 6f 78 47 72 6f radio.buttons:.*/.+..CheckboxGro
7aa0 75 70 20 63 68 65 63 6b 62 6f 78 20 3d 20 6e 65 77 20 43 68 65 63 6b 62 6f 78 47 72 6f 75 70 28 up.checkbox.=.new.CheckboxGroup(
7ac0 29 3b 0a 2b 09 09 61 63 63 65 70 74 20 3d 20 6e 65 77 20 43 68 65 63 6b 62 6f 78 28 73 31 2c 20 );.+..accept.=.new.Checkbox(s1,.
7ae0 74 72 75 65 2c 20 63 68 65 63 6b 62 6f 78 29 3b 0a 2b 09 09 64 65 6e 79 20 20 20 3d 20 6e 65 77 true,.checkbox);.+..deny...=.new
7b00 20 43 68 65 63 6b 62 6f 78 28 73 32 2c 20 66 61 6c 73 65 2c 20 63 68 65 63 6b 62 6f 78 29 3b 0a .Checkbox(s2,.false,.checkbox);.
7b20 2b 0a 2b 09 09 2f 2a 20 70 75 74 20 74 68 65 20 63 68 65 63 6b 62 6f 78 65 73 20 69 6e 20 61 20 +.+../*.put.the.checkboxes.in.a.
7b40 70 61 6e 65 6c 3a 20 2a 2f 0a 2b 09 09 50 61 6e 65 6c 20 63 68 65 63 6b 20 3d 20 6e 65 77 20 50 panel:.*/.+..Panel.check.=.new.P
7b60 61 6e 65 6c 28 29 3b 0a 2b 09 09 63 68 65 63 6b 2e 73 65 74 4c 61 79 6f 75 74 28 6e 65 77 20 47 anel();.+..check.setLayout(new.G
7b80 72 69 64 4c 61 79 6f 75 74 28 32 2c 20 31 29 29 3b 0a 2b 0a 2b 09 09 63 68 65 63 6b 2e 61 64 64 ridLayout(2,.1));.+.+..check.add
7ba0 28 61 63 63 65 70 74 29 3b 0a 2b 09 09 63 68 65 63 6b 2e 61 64 64 28 64 65 6e 79 29 3b 0a 2b 0a (accept);.+..check.add(deny);.+.
7bc0 2b 09 09 2f 2a 20 6d 61 6b 65 20 74 68 65 20 33 20 62 75 74 74 6f 6e 73 3a 20 2a 2f 0a 2b 09 09 +../*.make.the.3.buttons:.*/.+..
7be0 6f 6b 20 3d 20 6e 65 77 20 42 75 74 74 6f 6e 28 22 4f 4b 22 29 3b 0a 2b 09 09 63 61 6e 63 65 6c ok.=.new.Button("OK");.+..cancel
7c00 20 3d 20 6e 65 77 20 42 75 74 74 6f 6e 28 22 43 61 6e 63 65 6c 22 29 3b 0a 2b 09 09 76 69 65 77 .=.new.Button("Cancel");.+..view
7c20 63 65 72 74 20 3d 20 6e 65 77 20 42 75 74 74 6f 6e 28 22 56 69 65 77 20 43 65 72 74 69 66 69 63 cert.=.new.Button("View.Certific
7c40 61 74 65 22 29 3b 0a 2b 0a 2b 09 09 6f 6b 2e 61 64 64 41 63 74 69 6f 6e 4c 69 73 74 65 6e 65 72 ate");.+.+..ok.addActionListener
7c60 28 74 68 69 73 29 3b 0a 2b 09 09 63 61 6e 63 65 6c 2e 61 64 64 41 63 74 69 6f 6e 4c 69 73 74 65 (this);.+..cancel.addActionListe
7c80 6e 65 72 28 74 68 69 73 29 3b 0a 2b 09 09 76 69 65 77 63 65 72 74 2e 61 64 64 41 63 74 69 6f 6e ner(this);.+..viewcert.addAction
7ca0 4c 69 73 74 65 6e 65 72 28 74 68 69 73 29 3b 0a 2b 0a 2b 09 09 2f 2a 20 70 75 74 20 74 68 65 20 Listener(this);.+.+../*.put.the.
7cc0 62 75 74 74 6f 6e 73 20 69 6e 20 74 68 65 69 72 20 6f 77 6e 20 70 61 6e 65 6c 3a 20 2a 2f 0a 2b buttons.in.their.own.panel:.*/.+
7ce0 09 09 50 61 6e 65 6c 20 62 75 74 74 6f 6e 72 6f 77 20 3d 20 6e 65 77 20 50 61 6e 65 6c 28 29 3b ..Panel.buttonrow.=.new.Panel();
7d00 0a 2b 09 09 62 75 74 74 6f 6e 72 6f 77 2e 73 65 74 4c 61 79 6f 75 74 28 6e 65 77 20 46 6c 6f 77 .+..buttonrow.setLayout(new.Flow
7d20 4c 61 79 6f 75 74 28 46 6c 6f 77 4c 61 79 6f 75 74 2e 4c 45 46 54 29 29 3b 0a 2b 09 09 62 75 74 Layout(FlowLayout.LEFT));.+..but
7d40 74 6f 6e 72 6f 77 2e 61 64 64 28 76 69 65 77 63 65 72 74 29 3b 0a 2b 09 09 62 75 74 74 6f 6e 72 tonrow.add(viewcert);.+..buttonr
7d60 6f 77 2e 61 64 64 28 6f 6b 29 3b 0a 2b 09 09 62 75 74 74 6f 6e 72 6f 77 2e 61 64 64 28 63 61 6e ow.add(ok);.+..buttonrow.add(can
7d80 63 65 6c 29 3b 0a 2b 0a 2b 09 09 2f 2a 20 6c 61 62 65 6c 20 61 74 20 74 68 65 20 74 6f 70 3a 20 cel);.+.+../*.label.at.the.top:.
7da0 2a 2f 0a 2b 09 09 4c 61 62 65 6c 20 6c 61 62 65 6c 20 3d 20 6e 65 77 20 4c 61 62 65 6c 28 6d 73 */.+..Label.label.=.new.Label(ms
7dc0 67 2c 20 4c 61 62 65 6c 2e 43 45 4e 54 45 52 29 3b 0a 2b 09 09 6c 61 62 65 6c 2e 73 65 74 46 6f g,.Label.CENTER);.+..label.setFo
7de0 6e 74 28 6e 65 77 20 46 6f 6e 74 28 22 48 65 6c 76 65 74 69 63 61 22 2c 20 46 6f 6e 74 2e 42 4f nt(new.Font("Helvetica",.Font.BO
7e00 4c 44 2c 20 31 36 29 29 3b 0a 2b 0a 2b 09 09 2f 2a 20 74 65 78 74 61 72 65 61 20 69 6e 20 74 68 LD,.16));.+.+../*.textarea.in.th
7e20 65 20 6d 69 64 64 6c 65 20 2a 2f 0a 2b 09 09 74 65 78 74 61 72 65 61 20 3d 20 6e 65 77 20 54 65 e.middle.*/.+..textarea.=.new.Te
7e40 78 74 41 72 65 61 28 74 65 78 74 2c 20 33 36 2c 20 36 34 2c 0a 2b 09 09 20 20 20 20 54 65 78 74 xtArea(text,.36,.64,.+......Text
7e60 41 72 65 61 2e 53 43 52 4f 4c 4c 42 41 52 53 5f 56 45 52 54 49 43 41 4c 5f 4f 4e 4c 59 29 3b 0a Area.SCROLLBARS_VERTICAL_ONLY);.
7e80 2b 09 09 74 65 78 74 61 72 65 61 2e 73 65 74 45 64 69 74 61 62 6c 65 28 66 61 6c 73 65 29 3b 0a +..textarea.setEditable(false);.
7ea0 2b 0a 2b 09 09 2f 2a 20 70 75 74 20 74 68 65 20 74 77 6f 20 70 61 6e 65 6c 73 20 69 6e 20 74 68 +.+../*.put.the.two.panels.in.th
7ec0 65 69 72 20 6f 77 6e 20 70 61 6e 65 6c 20 61 74 20 62 6f 74 74 6f 6d 3a 20 2a 2f 0a 2b 09 09 50 eir.own.panel.at.bottom:.*/.+..P
7ee0 61 6e 65 6c 20 62 6f 74 20 3d 20 6e 65 77 20 50 61 6e 65 6c 28 29 3b 0a 2b 09 09 62 6f 74 2e 73 anel.bot.=.new.Panel();.+..bot.s
7f00 65 74 4c 61 79 6f 75 74 28 6e 65 77 20 47 72 69 64 4c 61 79 6f 75 74 28 32 2c 20 31 29 29 3b 0a etLayout(new.GridLayout(2,.1));.
7f20 2b 09 09 62 6f 74 2e 61 64 64 28 63 68 65 63 6b 29 3b 0a 2b 09 09 62 6f 74 2e 61 64 64 28 62 75 +..bot.add(check);.+..bot.add(bu
7f40 74 74 6f 6e 72 6f 77 29 3b 0a 2b 0a 2b 09 09 2f 2a 20 6e 6f 77 20 61 72 72 61 6e 67 65 20 74 68 ttonrow);.+.+../*.now.arrange.th
7f60 69 6e 67 73 20 69 6e 73 69 64 65 20 74 68 65 20 64 69 61 6c 6f 67 3a 20 2a 2f 0a 2b 09 09 64 69 ings.inside.the.dialog:.*/.+..di
7f80 61 6c 6f 67 2e 73 65 74 4c 61 79 6f 75 74 28 6e 65 77 20 42 6f 72 64 65 72 4c 61 79 6f 75 74 28 alog.setLayout(new.BorderLayout(
7fa0 29 29 3b 0a 2b 0a 2b 09 09 64 69 61 6c 6f 67 2e 61 64 64 28 22 4e 6f 72 74 68 22 2c 20 6c 61 62 ));.+.+..dialog.add("North",.lab
7fc0 65 6c 29 3b 0a 2b 09 09 64 69 61 6c 6f 67 2e 61 64 64 28 22 53 6f 75 74 68 22 2c 20 62 6f 74 29 el);.+..dialog.add("South",.bot)
7fe0 3b 0a 2b 09 09 64 69 61 6c 6f 67 2e 61 64 64 28 22 43 65 6e 74 65 72 22 2c 20 74 65 78 74 61 72 ;.+..dialog.add("Center",.textar
8000 65 61 29 3b 0a 2b 0a 2b 09 09 64 69 61 6c 6f 67 2e 70 61 63 6b 28 29 3b 0a 2b 09 09 64 69 61 6c ea);.+.+..dialog.pack();.+..dial
8020 6f 67 2e 72 65 73 69 7a 65 28 64 69 61 6c 6f 67 2e 70 72 65 66 65 72 72 65 64 53 69 7a 65 28 29 og.resize(dialog.preferredSize()
8040 29 3b 0a 2b 0a 2b 09 09 64 69 61 6c 6f 67 2e 73 68 6f 77 28 29 3b 09 2f 2a 20 62 6c 6f 63 6b 20 );.+.+..dialog.show();./*.block.
8060 68 65 72 65 20 74 69 6c 20 4f 4b 20 6f 72 20 43 61 6e 63 65 6c 20 70 72 65 73 73 65 64 2e 20 2a here.til.OK.or.Cancel.pressed..*
8080 2f 0a 2b 0a 2b 09 09 72 65 74 75 72 6e 20 74 72 75 73 74 5f 74 68 69 73 5f 73 65 73 73 69 6f 6e /.+.+..return.trust_this_session
80a0 3b 0a 2b 09 7d 0a 2b 0a 2b 09 70 75 62 6c 69 63 20 73 79 6e 63 68 72 6f 6e 69 7a 65 64 20 76 6f ;.+.}.+.+.public.synchronized.vo
80c0 69 64 20 61 63 74 69 6f 6e 50 65 72 66 6f 72 6d 65 64 28 41 63 74 69 6f 6e 45 76 65 6e 74 20 65 id.actionPerformed(ActionEvent.e
80e0 76 74 29 20 7b 0a 2b 0a 2b 09 09 69 66 20 28 65 76 74 2e 67 65 74 53 6f 75 72 63 65 28 29 20 3d vt).{.+.+..if.(evt.getSource().=
8100 3d 20 76 69 65 77 63 65 72 74 29 20 7b 0a 2b 09 09 09 2f 2a 20 56 69 65 77 20 43 65 72 74 69 66 =.viewcert).{.+.../*.View.Certif
8120 69 63 61 74 65 20 62 75 74 74 6f 6e 20 63 6c 69 63 6b 65 64 20 2a 2f 0a 2b 09 09 09 69 66 20 28 icate.button.clicked.*/.+...if.(
8140 76 69 65 77 69 6e 67 5f 63 65 72 74 29 20 7b 0a 2b 09 09 09 09 2f 2a 20 73 68 6f 77 20 74 68 65 viewing_cert).{.+..../*.show.the
8160 20 6f 72 69 67 69 6e 61 6c 20 69 6e 66 6f 20 74 65 78 74 3a 20 2a 2f 0a 2b 09 09 09 09 74 65 78 .original.info.text:.*/.+....tex
8180 74 61 72 65 61 2e 73 65 74 54 65 78 74 28 74 65 78 74 29 3b 0a 2b 09 09 09 09 76 69 65 77 63 65 tarea.setText(text);.+....viewce
81a0 72 74 2e 73 65 74 4c 61 62 65 6c 28 22 56 69 65 77 20 43 65 72 74 69 66 69 63 61 74 65 22 29 3b rt.setLabel("View.Certificate");
81c0 0a 2b 09 09 09 09 76 69 65 77 69 6e 67 5f 63 65 72 74 20 3d 20 66 61 6c 73 65 3b 0a 2b 09 09 09 .+....viewing_cert.=.false;.+...
81e0 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 09 69 6e 74 20 69 3b 0a 2b 09 09 09 09 2f 2a 20 73 68 6f }.else.{.+....int.i;.+..../*.sho
8200 77 20 61 6c 6c 20 28 6c 69 6b 65 6c 79 20 6a 75 73 74 20 6f 6e 65 29 20 63 65 72 74 73 3a 20 2a w.all.(likely.just.one).certs:.*
8220 2f 0a 2b 09 09 09 09 74 65 78 74 61 72 65 61 2e 73 65 74 54 65 78 74 28 22 22 29 3b 0a 2b 09 09 /.+....textarea.setText("");.+..
8240 09 09 66 6f 72 20 28 69 3d 30 3b 20 69 20 3c 20 74 72 75 73 74 61 6c 6c 43 65 72 74 73 2e 6c 65 ..for.(i=0;.i.<.trustallCerts.le
8260 6e 67 74 68 3b 20 69 2b 2b 29 20 7b 0a 2b 09 09 09 09 09 69 6e 74 20 6a 20 3d 20 69 20 2b 20 31 ngth;.i++).{.+.....int.j.=.i.+.1
8280 3b 0a 2b 09 09 09 09 09 74 65 78 74 61 72 65 61 2e 61 70 70 65 6e 64 28 22 43 65 72 74 69 66 69 ;.+.....textarea.append("Certifi
82a0 63 61 74 65 5b 22 20 2b 0a 2b 09 09 09 09 09 20 20 20 20 6a 20 2b 20 22 5d 5c 6e 5c 6e 22 29 3b cate[".+.+.........j.+."]\n\n");
82c0 0a 2b 09 09 09 09 09 74 65 78 74 61 72 65 61 2e 61 70 70 65 6e 64 28 0a 2b 09 09 09 09 09 20 20 .+.....textarea.append(.+.......
82e0 20 20 74 72 75 73 74 61 6c 6c 43 65 72 74 73 5b 69 5d 2e 74 6f 53 74 72 69 6e 67 28 29 29 3b 0a ..trustallCerts[i].toString());.
8300 2b 09 09 09 09 09 74 65 78 74 61 72 65 61 2e 61 70 70 65 6e 64 28 6c 6e 29 3b 0a 2b 09 09 09 09 +.....textarea.append(ln);.+....
8320 7d 0a 2b 09 09 09 09 76 69 65 77 63 65 72 74 2e 73 65 74 4c 61 62 65 6c 28 22 56 69 65 77 20 49 }.+....viewcert.setLabel("View.I
8340 6e 66 6f 22 29 3b 0a 2b 09 09 09 09 76 69 65 77 69 6e 67 5f 63 65 72 74 20 3d 20 74 72 75 65 3b nfo");.+....viewing_cert.=.true;
8360 0a 2b 0a 2b 09 09 09 09 74 65 78 74 61 72 65 61 2e 73 65 74 43 61 72 65 74 50 6f 73 69 74 69 6f .+.+....textarea.setCaretPositio
8380 6e 28 30 29 3b 0a 2b 09 09 09 7d 0a 2b 0a 2b 09 09 7d 20 65 6c 73 65 20 69 66 20 28 65 76 74 2e n(0);.+...}.+.+..}.else.if.(evt.
83a0 67 65 74 53 6f 75 72 63 65 28 29 20 3d 3d 20 6f 6b 29 20 7b 0a 2b 09 09 09 2f 2a 20 4f 4b 20 62 getSource().==.ok).{.+.../*.OK.b
83c0 75 74 74 6f 6e 20 63 6c 69 63 6b 65 64 20 2a 2f 0a 2b 09 09 09 69 66 20 28 61 63 63 65 70 74 2e utton.clicked.*/.+...if.(accept.
83e0 67 65 74 53 74 61 74 65 28 29 29 20 7b 0a 2b 09 09 09 09 74 72 75 73 74 5f 74 68 69 73 5f 73 65 getState()).{.+....trust_this_se
8400 73 73 69 6f 6e 20 3d 20 74 72 75 65 3b 0a 2b 09 09 09 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 09 ssion.=.true;.+...}.else.{.+....
8420 74 72 75 73 74 5f 74 68 69 73 5f 73 65 73 73 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0a 2b 09 09 09 trust_this_session.=.false;.+...
8440 7d 0a 2b 09 09 09 64 69 61 6c 6f 67 2e 64 69 73 70 6f 73 65 28 29 3b 0a 2b 0a 2b 09 09 7d 20 65 }.+...dialog.dispose();.+.+..}.e
8460 6c 73 65 20 69 66 20 28 65 76 74 2e 67 65 74 53 6f 75 72 63 65 28 29 20 3d 3d 20 63 61 6e 63 65 lse.if.(evt.getSource().==.cance
8480 6c 29 20 7b 0a 2b 09 09 09 2f 2a 20 43 61 6e 63 65 6c 20 62 75 74 74 6f 6e 20 63 6c 69 63 6b 65 l).{.+.../*.Cancel.button.clicke
84a0 64 20 2a 2f 0a 2b 09 09 09 74 72 75 73 74 5f 74 68 69 73 5f 73 65 73 73 69 6f 6e 20 3d 20 66 61 d.*/.+...trust_this_session.=.fa
84c0 6c 73 65 3b 0a 2b 0a 2b 09 09 09 64 69 61 6c 6f 67 2e 64 69 73 70 6f 73 65 28 29 3b 0a 2b 09 09 lse;.+.+...dialog.dispose();.+..
84e0 7d 0a 2b 09 7d 0a 2b 0a 2b 09 53 74 72 69 6e 67 20 67 65 74 5f 63 65 72 74 69 6e 66 6f 28 29 20 }.+.}.+.+.String.get_certinfo().
8500 7b 0a 2b 09 09 53 74 72 69 6e 67 20 61 6c 6c 20 3d 20 22 22 3b 0a 2b 09 09 53 74 72 69 6e 67 20 {.+..String.all.=."";.+..String.
8520 66 69 65 6c 64 73 5b 5d 20 3d 20 7b 22 43 4e 22 2c 20 22 4f 55 22 2c 20 22 4f 22 2c 20 22 4c 22 fields[].=.{"CN",."OU",."O",."L"
8540 2c 20 22 43 22 7d 3b 0a 2b 09 09 69 6e 74 20 69 3b 0a 2b 09 09 69 66 20 28 74 72 75 73 74 61 6c ,."C"};.+..int.i;.+..if.(trustal
8560 6c 43 65 72 74 73 2e 6c 65 6e 67 74 68 20 3c 20 31 29 20 7b 0a 2b 09 09 09 61 6c 6c 20 3d 20 22 lCerts.length.<.1).{.+...all.=."
8580 22 3b 0a 2b 09 09 09 72 65 74 75 72 6e 20 61 6c 6c 3b 0a 2b 09 09 7d 0a 2b 09 09 53 74 72 69 6e ";.+...return.all;.+..}.+..Strin
85a0 67 20 63 65 72 74 20 3d 20 74 72 75 73 74 61 6c 6c 43 65 72 74 73 5b 30 5d 2e 74 6f 53 74 72 69 g.cert.=.trustallCerts[0].toStri
85c0 6e 67 28 29 3b 0a 2b 0a 2b 09 09 2f 2a 0a 2b 09 09 20 2a 20 46 6f 72 20 6e 6f 77 20 77 65 20 73 ng();.+.+../*.+...*.For.now.we.s
85e0 69 6d 70 6c 79 20 73 63 72 61 70 65 20 74 68 65 20 63 65 72 74 20 73 74 72 69 6e 67 2c 20 74 68 imply.scrape.the.cert.string,.th
8600 65 72 65 20 6d 75 73 74 0a 2b 09 09 20 2a 20 62 65 20 61 6e 20 41 50 49 20 66 6f 72 20 74 68 69 ere.must.+...*.be.an.API.for.thi
8620 73 2e 2e 2e 20 70 65 72 68 61 70 73 20 6f 70 74 69 6f 6e 56 61 6c 75 65 3f 0a 2b 09 09 20 2a 2f s....perhaps.optionValue?.+...*/
8640 0a 2b 0a 2b 09 09 66 6f 72 20 28 69 3d 30 3b 20 69 20 3c 20 66 69 65 6c 64 73 2e 6c 65 6e 67 74 .+.+..for.(i=0;.i.<.fields.lengt
8660 68 3b 20 69 2b 2b 29 20 7b 0a 2b 09 09 09 69 6e 74 20 66 2c 20 74 2c 20 74 31 2c 20 74 32 3b 0a h;.i++).{.+...int.f,.t,.t1,.t2;.
8680 2b 09 09 09 53 74 72 69 6e 67 20 73 75 62 2c 20 6d 61 74 20 3d 20 66 69 65 6c 64 73 5b 69 5d 20 +...String.sub,.mat.=.fields[i].
86a0 2b 20 22 3d 22 3b 0a 2b 09 09 09 0a 2b 09 09 09 66 20 3d 20 63 65 72 74 2e 69 6e 64 65 78 4f 66 +."=";.+....+...f.=.cert.indexOf
86c0 28 6d 61 74 2c 20 30 29 3b 0a 2b 09 09 09 69 66 20 28 66 20 3e 20 30 29 20 7b 0a 2b 09 09 09 09 (mat,.0);.+...if.(f.>.0).{.+....
86e0 74 31 20 3d 20 63 65 72 74 2e 69 6e 64 65 78 4f 66 28 22 2c 20 22 2c 20 66 29 3b 0a 2b 09 09 09 t1.=.cert.indexOf(",.",.f);.+...
8700 09 74 32 20 3d 20 63 65 72 74 2e 69 6e 64 65 78 4f 66 28 22 5c 6e 22 2c 20 66 29 3b 0a 2b 09 09 .t2.=.cert.indexOf("\n",.f);.+..
8720 09 09 69 66 20 28 74 31 20 3c 20 30 20 26 26 20 74 32 20 3c 20 30 29 20 7b 0a 2b 09 09 09 09 09 ..if.(t1.<.0.&&.t2.<.0).{.+.....
8740 63 6f 6e 74 69 6e 75 65 3b 0a 2b 09 09 09 09 7d 20 65 6c 73 65 20 69 66 20 28 74 31 20 3c 20 30 continue;.+....}.else.if.(t1.<.0
8760 29 20 7b 0a 2b 09 09 09 09 09 74 20 3d 20 74 32 3b 0a 2b 09 09 09 09 7d 20 65 6c 73 65 20 69 66 ).{.+.....t.=.t2;.+....}.else.if
8780 20 28 74 32 20 3c 20 30 29 20 7b 0a 2b 09 09 09 09 09 74 20 3d 20 74 31 3b 0a 2b 09 09 09 09 7d .(t2.<.0).{.+.....t.=.t1;.+....}
87a0 20 65 6c 73 65 20 69 66 20 28 74 31 20 3c 20 74 32 29 20 7b 0a 2b 09 09 09 09 09 74 20 3d 20 74 .else.if.(t1.<.t2).{.+.....t.=.t
87c0 31 3b 0a 2b 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 09 09 74 20 3d 20 74 32 3b 0a 2b 1;.+....}.else.{.+.....t.=.t2;.+
87e0 09 09 09 09 7d 0a 2b 09 09 09 09 69 66 20 28 74 20 3e 20 66 29 20 7b 0a 2b 09 09 09 09 09 73 75 ....}.+....if.(t.>.f).{.+.....su
8800 62 20 3d 20 63 65 72 74 2e 73 75 62 73 74 72 69 6e 67 28 66 2c 20 74 29 3b 0a 2b 09 09 09 09 09 b.=.cert.substring(f,.t);.+.....
8820 61 6c 6c 20 3d 20 61 6c 6c 20 2b 20 22 20 20 20 20 20 20 20 20 22 20 2b 20 73 75 62 20 2b 20 22 all.=.all.+."........".+.sub.+."
8840 5c 6e 22 3b 0a 2b 09 09 09 09 7d 0a 2b 09 09 09 7d 0a 2b 09 09 7d 0a 2b 09 09 72 65 74 75 72 6e \n";.+....}.+...}.+..}.+..return
8860 20 61 6c 6c 3b 0a 2b 09 7d 0a 2b 7d 0a 2b 0a 2b 63 6c 61 73 73 20 50 72 6f 78 79 44 69 61 6c 6f .all;.+.}.+}.+.+class.ProxyDialo
8880 67 20 69 6d 70 6c 65 6d 65 6e 74 73 20 41 63 74 69 6f 6e 4c 69 73 74 65 6e 65 72 20 7b 0a 2b 09 g.implements.ActionListener.{.+.
88a0 53 74 72 69 6e 67 20 67 75 65 73 73 65 64 48 6f 73 74 20 3d 20 6e 75 6c 6c 3b 0a 2b 09 53 74 72 String.guessedHost.=.null;.+.Str
88c0 69 6e 67 20 67 75 65 73 73 65 64 50 6f 72 74 20 3d 20 6e 75 6c 6c 3b 0a 2b 09 2f 2a 0a 2b 09 20 ing.guessedPort.=.null;.+./*.+..
88e0 2a 20 74 68 69 73 20 69 73 20 74 68 65 20 67 75 69 20 74 6f 20 73 68 6f 77 20 74 68 65 20 75 73 *.this.is.the.gui.to.show.the.us
8900 65 72 20 74 68 65 20 63 65 72 74 20 61 6e 64 20 69 6e 66 6f 20 61 6e 64 20 61 73 6b 0a 2b 09 20 er.the.cert.and.info.and.ask.+..
8920 2a 20 74 68 65 6d 20 69 66 20 74 68 65 79 20 77 61 6e 74 20 74 6f 20 63 6f 6e 74 69 6e 75 65 20 *.them.if.they.want.to.continue.
8940 75 73 69 6e 67 20 74 68 69 73 20 63 65 72 74 2e 0a 2b 09 20 2a 2f 0a 2b 0a 2b 09 42 75 74 74 6f using.this.cert..+..*/.+.+.Butto
8960 6e 20 6f 6b 3b 0a 2b 09 44 69 61 6c 6f 67 20 64 69 61 6c 6f 67 3b 0a 2b 09 54 65 78 74 46 69 65 n.ok;.+.Dialog.dialog;.+.TextFie
8980 6c 64 20 65 6e 74 72 79 3b 0a 2b 09 53 74 72 69 6e 67 20 72 65 70 6c 79 20 3d 20 22 22 3b 0a 2b ld.entry;.+.String.reply.=."";.+
89a0 0a 2b 09 50 72 6f 78 79 44 69 61 6c 6f 67 20 28 53 74 72 69 6e 67 20 68 2c 20 69 6e 74 20 70 29 .+.ProxyDialog.(String.h,.int.p)
89c0 20 7b 0a 2b 09 09 67 75 65 73 73 65 64 48 6f 73 74 20 3d 20 68 3b 0a 2b 09 09 74 72 79 20 7b 0a .{.+..guessedHost.=.h;.+..try.{.
89e0 2b 09 09 09 67 75 65 73 73 65 64 50 6f 72 74 20 3d 20 49 6e 74 65 67 65 72 2e 74 6f 53 74 72 69 +...guessedPort.=.Integer.toStri
8a00 6e 67 28 70 29 3b 0a 2b 09 09 7d 20 63 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 ng(p);.+..}.catch.(Exception.e).
8a20 7b 0a 2b 09 09 09 67 75 65 73 73 65 64 50 6f 72 74 20 3d 20 22 38 30 38 30 22 3b 0a 2b 09 09 7d {.+...guessedPort.=."8080";.+..}
8a40 0a 2b 09 7d 0a 2b 0a 2b 09 70 75 62 6c 69 63 20 76 6f 69 64 20 71 75 65 72 79 55 73 65 72 28 29 .+.}.+.+.public.void.queryUser()
8a60 20 7b 0a 2b 0a 2b 09 09 2f 2a 20 63 72 65 61 74 65 20 61 6e 64 20 64 69 73 70 6c 61 79 20 74 68 .{.+.+../*.create.and.display.th
8a80 65 20 64 69 61 6c 6f 67 20 66 6f 72 20 75 6e 76 65 72 69 66 69 65 64 20 63 65 72 74 2e 20 2a 2f e.dialog.for.unverified.cert..*/
8aa0 0a 2b 0a 2b 09 09 46 72 61 6d 65 20 66 72 61 6d 65 20 3d 20 6e 65 77 20 46 72 61 6d 65 28 22 4e .+.+..Frame.frame.=.new.Frame("N
8ac0 65 65 64 20 50 72 6f 78 79 20 68 6f 73 74 3a 70 6f 72 74 22 29 3b 0a 2b 0a 2b 09 09 64 69 61 6c eed.Proxy.host:port");.+.+..dial
8ae0 6f 67 20 3d 20 6e 65 77 20 44 69 61 6c 6f 67 28 66 72 61 6d 65 2c 20 74 72 75 65 29 3b 0a 2b 0a og.=.new.Dialog(frame,.true);.+.
8b00 2b 0a 2b 09 09 4c 61 62 65 6c 20 6c 61 62 65 6c 20 3d 20 6e 65 77 20 4c 61 62 65 6c 28 22 50 6c +.+..Label.label.=.new.Label("Pl
8b20 65 61 73 65 20 45 6e 74 65 72 20 79 6f 75 72 20 68 74 74 70 73 20 50 72 6f 78 79 20 69 6e 66 6f ease.Enter.your.https.Proxy.info
8b40 20 61 73 20 68 6f 73 74 3a 70 6f 72 74 22 2c 20 4c 61 62 65 6c 2e 43 45 4e 54 45 52 29 3b 0a 2b .as.host:port",.Label.CENTER);.+
8b60 09 09 2f 2f 6c 61 62 65 6c 2e 73 65 74 46 6f 6e 74 28 6e 65 77 20 46 6f 6e 74 28 22 48 65 6c 76 ..//label.setFont(new.Font("Helv
8b80 65 74 69 63 61 22 2c 20 46 6f 6e 74 2e 42 4f 4c 44 2c 20 31 36 29 29 3b 0a 2b 09 09 65 6e 74 72 etica",.Font.BOLD,.16));.+..entr
8ba0 79 20 3d 20 6e 65 77 20 54 65 78 74 46 69 65 6c 64 28 33 30 29 3b 0a 2b 09 09 6f 6b 20 3d 20 6e y.=.new.TextField(30);.+..ok.=.n
8bc0 65 77 20 42 75 74 74 6f 6e 28 22 4f 4b 22 29 3b 0a 2b 09 09 6f 6b 2e 61 64 64 41 63 74 69 6f 6e ew.Button("OK");.+..ok.addAction
8be0 4c 69 73 74 65 6e 65 72 28 74 68 69 73 29 3b 0a 2b 0a 2b 09 09 53 74 72 69 6e 67 20 67 75 65 73 Listener(this);.+.+..String.gues
8c00 73 20 3d 20 22 22 3b 0a 2b 09 09 69 66 20 28 67 75 65 73 73 65 64 48 6f 73 74 20 21 3d 20 6e 75 s.=."";.+..if.(guessedHost.!=.nu
8c20 6c 6c 29 20 7b 0a 2b 09 09 09 67 75 65 73 73 20 3d 20 67 75 65 73 73 65 64 48 6f 73 74 20 2b 20 ll).{.+...guess.=.guessedHost.+.
8c40 22 3a 22 20 2b 20 67 75 65 73 73 65 64 50 6f 72 74 3b 0a 2b 09 09 7d 0a 2b 09 09 65 6e 74 72 79 ":".+.guessedPort;.+..}.+..entry
8c60 2e 73 65 74 54 65 78 74 28 67 75 65 73 73 29 3b 0a 2b 0a 2b 09 09 64 69 61 6c 6f 67 2e 73 65 74 .setText(guess);.+.+..dialog.set
8c80 4c 61 79 6f 75 74 28 6e 65 77 20 42 6f 72 64 65 72 4c 61 79 6f 75 74 28 29 29 3b 0a 2b 09 09 64 Layout(new.BorderLayout());.+..d
8ca0 69 61 6c 6f 67 2e 61 64 64 28 22 4e 6f 72 74 68 22 2c 20 6c 61 62 65 6c 29 3b 0a 2b 09 09 64 69 ialog.add("North",.label);.+..di
8cc0 61 6c 6f 67 2e 61 64 64 28 22 43 65 6e 74 65 72 22 2c 20 65 6e 74 72 79 29 3b 0a 2b 09 09 64 69 alog.add("Center",.entry);.+..di
8ce0 61 6c 6f 67 2e 61 64 64 28 22 53 6f 75 74 68 22 2c 20 6f 6b 29 3b 0a 2b 09 09 64 69 61 6c 6f 67 alog.add("South",.ok);.+..dialog
8d00 2e 70 61 63 6b 28 29 3b 0a 2b 09 09 64 69 61 6c 6f 67 2e 72 65 73 69 7a 65 28 64 69 61 6c 6f 67 .pack();.+..dialog.resize(dialog
8d20 2e 70 72 65 66 65 72 72 65 64 53 69 7a 65 28 29 29 3b 0a 2b 0a 2b 09 09 64 69 61 6c 6f 67 2e 73 .preferredSize());.+.+..dialog.s
8d40 68 6f 77 28 29 3b 09 2f 2a 20 62 6c 6f 63 6b 20 68 65 72 65 20 74 69 6c 20 4f 4b 20 6f 72 20 43 how();./*.block.here.til.OK.or.C
8d60 61 6e 63 65 6c 20 70 72 65 73 73 65 64 2e 20 2a 2f 0a 2b 09 09 72 65 74 75 72 6e 3b 0a 2b 09 7d ancel.pressed..*/.+..return;.+.}
8d80 0a 2b 0a 2b 09 70 75 62 6c 69 63 20 53 74 72 69 6e 67 20 67 65 74 48 6f 73 74 28 29 20 7b 0a 2b .+.+.public.String.getHost().{.+
8da0 09 09 69 6e 74 20 69 20 3d 20 72 65 70 6c 79 2e 69 6e 64 65 78 4f 66 28 22 3a 22 29 3b 0a 2b 09 ..int.i.=.reply.indexOf(":");.+.
8dc0 09 69 66 20 28 69 20 3c 20 30 29 20 7b 0a 2b 09 09 09 72 65 74 75 72 6e 20 22 75 6e 6b 6e 6f 77 .if.(i.<.0).{.+...return."unknow
8de0 6e 22 3b 0a 2b 09 09 7d 0a 2b 09 09 53 74 72 69 6e 67 20 68 20 3d 20 72 65 70 6c 79 2e 73 75 62 n";.+..}.+..String.h.=.reply.sub
8e00 73 74 72 69 6e 67 28 30 2c 20 69 29 3b 0a 2b 09 09 72 65 74 75 72 6e 20 68 3b 0a 2b 09 7d 0a 2b string(0,.i);.+..return.h;.+.}.+
8e20 0a 2b 09 70 75 62 6c 69 63 20 69 6e 74 20 67 65 74 50 6f 72 74 28 29 20 7b 0a 2b 09 09 69 6e 74 .+.public.int.getPort().{.+..int
8e40 20 69 20 3d 20 72 65 70 6c 79 2e 69 6e 64 65 78 4f 66 28 22 3a 22 29 3b 0a 2b 09 09 69 6e 74 20 .i.=.reply.indexOf(":");.+..int.
8e60 70 20 3d 20 38 30 38 30 3b 0a 2b 09 09 69 66 20 28 69 20 3c 20 30 29 20 7b 0a 2b 09 09 09 72 65 p.=.8080;.+..if.(i.<.0).{.+...re
8e80 74 75 72 6e 20 70 3b 0a 2b 09 09 7d 0a 2b 09 09 69 2b 2b 3b 0a 2b 09 09 53 74 72 69 6e 67 20 70 turn.p;.+..}.+..i++;.+..String.p
8ea0 73 20 3d 20 72 65 70 6c 79 2e 73 75 62 73 74 72 69 6e 67 28 69 29 3b 0a 2b 09 09 74 72 79 20 7b s.=.reply.substring(i);.+..try.{
8ec0 0a 2b 09 09 09 49 6e 74 65 67 65 72 20 49 20 3d 20 6e 65 77 20 49 6e 74 65 67 65 72 28 70 73 29 .+...Integer.I.=.new.Integer(ps)
8ee0 3b 0a 2b 09 09 09 70 20 3d 20 49 2e 69 6e 74 56 61 6c 75 65 28 29 3b 0a 2b 09 09 7d 20 63 61 74 ;.+...p.=.I.intValue();.+..}.cat
8f00 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 65 29 20 7b 0a 2b 09 09 09 3b 0a 2b 09 09 7d 0a 2b 09 ch.(Exception.e).{.+...;.+..}.+.
8f20 09 72 65 74 75 72 6e 20 70 3b 0a 2b 09 7d 0a 2b 0a 2b 09 70 75 62 6c 69 63 20 73 79 6e 63 68 72 .return.p;.+.}.+.+.public.synchr
8f40 6f 6e 69 7a 65 64 20 76 6f 69 64 20 61 63 74 69 6f 6e 50 65 72 66 6f 72 6d 65 64 28 41 63 74 69 onized.void.actionPerformed(Acti
8f60 6f 6e 45 76 65 6e 74 20 65 76 74 29 20 7b 0a 2b 09 09 53 79 73 74 65 6d 2e 6f 75 74 2e 70 72 69 onEvent.evt).{.+..System.out.pri
8f80 6e 74 6c 6e 28 65 76 74 2e 67 65 74 41 63 74 69 6f 6e 43 6f 6d 6d 61 6e 64 28 29 29 3b 0a 2b 09 ntln(evt.getActionCommand());.+.
8fa0 09 69 66 20 28 65 76 74 2e 67 65 74 53 6f 75 72 63 65 28 29 20 3d 3d 20 6f 6b 29 20 7b 0a 2b 09 .if.(evt.getSource().==.ok).{.+.
8fc0 09 09 72 65 70 6c 79 20 3d 20 65 6e 74 72 79 2e 67 65 74 54 65 78 74 28 29 3b 0a 2b 09 09 09 64 ..reply.=.entry.getText();.+...d
8fe0 69 61 6c 6f 67 2e 64 69 73 70 6f 73 65 28 29 3b 0a 2b 09 09 7d 0a 2b 09 7d 0a 2b 7d 0a 2b 0a 2b ialog.dispose();.+..}.+.}.+}.+.+
9000 63 6c 61 73 73 20 43 6c 69 65 6e 74 43 65 72 74 44 69 61 6c 6f 67 20 69 6d 70 6c 65 6d 65 6e 74 class.ClientCertDialog.implement
9020 73 20 41 63 74 69 6f 6e 4c 69 73 74 65 6e 65 72 20 7b 0a 2b 0a 2b 09 42 75 74 74 6f 6e 20 6f 6b s.ActionListener.{.+.+.Button.ok
9040 3b 0a 2b 09 44 69 61 6c 6f 67 20 64 69 61 6c 6f 67 3b 0a 2b 09 54 65 78 74 46 69 65 6c 64 20 65 ;.+.Dialog.dialog;.+.TextField.e
9060 6e 74 72 79 3b 0a 2b 09 53 74 72 69 6e 67 20 72 65 70 6c 79 20 3d 20 22 22 3b 0a 2b 0a 2b 09 43 ntry;.+.String.reply.=."";.+.+.C
9080 6c 69 65 6e 74 43 65 72 74 44 69 61 6c 6f 67 28 29 20 7b 0a 2b 09 09 3b 0a 2b 09 7d 0a 2b 0a 2b lientCertDialog().{.+..;.+.}.+.+
90a0 09 70 75 62 6c 69 63 20 53 74 72 69 6e 67 20 71 75 65 72 79 55 73 65 72 28 29 20 7b 0a 2b 0a 2b .public.String.queryUser().{.+.+
90c0 09 09 2f 2a 20 63 72 65 61 74 65 20 61 6e 64 20 64 69 73 70 6c 61 79 20 74 68 65 20 64 69 61 6c ../*.create.and.display.the.dial
90e0 6f 67 20 66 6f 72 20 75 6e 76 65 72 69 66 69 65 64 20 63 65 72 74 2e 20 2a 2f 0a 2b 0a 2b 09 09 og.for.unverified.cert..*/.+.+..
9100 46 72 61 6d 65 20 66 72 61 6d 65 20 3d 20 6e 65 77 20 46 72 61 6d 65 28 22 45 6e 74 65 72 20 53 Frame.frame.=.new.Frame("Enter.S
9120 53 4c 20 43 6c 69 65 6e 74 20 43 65 72 74 2b 4b 65 79 20 53 74 72 69 6e 67 22 29 3b 0a 2b 0a 2b SL.Client.Cert+Key.String");.+.+
9140 09 09 64 69 61 6c 6f 67 20 3d 20 6e 65 77 20 44 69 61 6c 6f 67 28 66 72 61 6d 65 2c 20 74 72 75 ..dialog.=.new.Dialog(frame,.tru
9160 65 29 3b 0a 2b 0a 2b 0a 2b 09 09 4c 61 62 65 6c 20 6c 61 62 65 6c 20 3d 20 6e 65 77 20 4c 61 62 e);.+.+.+..Label.label.=.new.Lab
9180 65 6c 28 22 50 6c 65 61 73 65 20 45 6e 74 65 72 20 74 68 65 20 53 53 4c 20 43 6c 69 65 6e 74 20 el("Please.Enter.the.SSL.Client.
91a0 43 65 72 74 2b 4b 65 79 20 53 74 72 69 6e 67 20 33 30 38 32 30 34 63 30 2e 2e 2e 2c 2e 2e 2e 35 Cert+Key.String.308204c0...,...5
91c0 32 32 64 32 64 30 61 22 2c 20 4c 61 62 65 6c 2e 43 45 4e 54 45 52 29 3b 0a 2b 09 09 65 6e 74 72 22d2d0a",.Label.CENTER);.+..entr
91e0 79 20 3d 20 6e 65 77 20 54 65 78 74 46 69 65 6c 64 28 33 30 29 3b 0a 2b 09 09 6f 6b 20 3d 20 6e y.=.new.TextField(30);.+..ok.=.n
9200 65 77 20 42 75 74 74 6f 6e 28 22 4f 4b 22 29 3b 0a 2b 09 09 6f 6b 2e 61 64 64 41 63 74 69 6f 6e ew.Button("OK");.+..ok.addAction
9220 4c 69 73 74 65 6e 65 72 28 74 68 69 73 29 3b 0a 2b 0a 2b 09 09 64 69 61 6c 6f 67 2e 73 65 74 4c Listener(this);.+.+..dialog.setL
9240 61 79 6f 75 74 28 6e 65 77 20 42 6f 72 64 65 72 4c 61 79 6f 75 74 28 29 29 3b 0a 2b 09 09 64 69 ayout(new.BorderLayout());.+..di
9260 61 6c 6f 67 2e 61 64 64 28 22 4e 6f 72 74 68 22 2c 20 6c 61 62 65 6c 29 3b 0a 2b 09 09 64 69 61 alog.add("North",.label);.+..dia
9280 6c 6f 67 2e 61 64 64 28 22 43 65 6e 74 65 72 22 2c 20 65 6e 74 72 79 29 3b 0a 2b 09 09 64 69 61 log.add("Center",.entry);.+..dia
92a0 6c 6f 67 2e 61 64 64 28 22 53 6f 75 74 68 22 2c 20 6f 6b 29 3b 0a 2b 09 09 64 69 61 6c 6f 67 2e log.add("South",.ok);.+..dialog.
92c0 70 61 63 6b 28 29 3b 0a 2b 09 09 64 69 61 6c 6f 67 2e 72 65 73 69 7a 65 28 64 69 61 6c 6f 67 2e pack();.+..dialog.resize(dialog.
92e0 70 72 65 66 65 72 72 65 64 53 69 7a 65 28 29 29 3b 0a 2b 0a 2b 09 09 64 69 61 6c 6f 67 2e 73 68 preferredSize());.+.+..dialog.sh
9300 6f 77 28 29 3b 09 2f 2a 20 62 6c 6f 63 6b 20 68 65 72 65 20 74 69 6c 20 4f 4b 20 6f 72 20 43 61 ow();./*.block.here.til.OK.or.Ca
9320 6e 63 65 6c 20 70 72 65 73 73 65 64 2e 20 2a 2f 0a 2b 09 09 72 65 74 75 72 6e 20 72 65 70 6c 79 ncel.pressed..*/.+..return.reply
9340 3b 0a 2b 09 7d 0a 2b 0a 2b 09 70 75 62 6c 69 63 20 73 79 6e 63 68 72 6f 6e 69 7a 65 64 20 76 6f ;.+.}.+.+.public.synchronized.vo
9360 69 64 20 61 63 74 69 6f 6e 50 65 72 66 6f 72 6d 65 64 28 41 63 74 69 6f 6e 45 76 65 6e 74 20 65 id.actionPerformed(ActionEvent.e
9380 76 74 29 20 7b 0a 2b 09 09 53 79 73 74 65 6d 2e 6f 75 74 2e 70 72 69 6e 74 6c 6e 28 65 76 74 2e vt).{.+..System.out.println(evt.
93a0 67 65 74 41 63 74 69 6f 6e 43 6f 6d 6d 61 6e 64 28 29 29 3b 0a 2b 09 09 69 66 20 28 65 76 74 2e getActionCommand());.+..if.(evt.
93c0 67 65 74 53 6f 75 72 63 65 28 29 20 3d 3d 20 6f 6b 29 20 7b 0a 2b 09 09 09 72 65 70 6c 79 20 3d getSource().==.ok).{.+...reply.=
93e0 20 65 6e 74 72 79 2e 67 65 74 54 65 78 74 28 29 3b 0a 2b 09 09 09 64 69 61 6c 6f 67 2e 64 69 73 .entry.getText();.+...dialog.dis
9400 70 6f 73 65 28 29 3b 0a 2b 09 09 7d 0a 2b 09 7d 0a 2b 7d 0a 2b 0a 2b 63 6c 61 73 73 20 42 72 6f pose();.+..}.+.}.+}.+.+class.Bro
9420 77 73 65 72 43 65 72 74 73 44 69 61 6c 6f 67 20 69 6d 70 6c 65 6d 65 6e 74 73 20 41 63 74 69 6f wserCertsDialog.implements.Actio
9440 6e 4c 69 73 74 65 6e 65 72 20 7b 0a 2b 09 42 75 74 74 6f 6e 20 79 65 73 2c 20 6e 6f 3b 0a 2b 09 nListener.{.+.Button.yes,.no;.+.
9460 44 69 61 6c 6f 67 20 64 69 61 6c 6f 67 3b 0a 2b 09 53 74 72 69 6e 67 20 76 6e 63 53 65 72 76 65 Dialog.dialog;.+.String.vncServe
9480 72 3b 0a 2b 09 53 74 72 69 6e 67 20 68 6f 73 74 70 6f 72 74 3b 0a 2b 09 70 75 62 6c 69 63 20 62 r;.+.String.hostport;.+.public.b
94a0 6f 6f 6c 65 61 6e 20 73 68 6f 77 43 65 72 74 44 69 61 6c 6f 67 20 3d 20 74 72 75 65 3b 0a 2b 0a oolean.showCertDialog.=.true;.+.
94c0 2b 09 42 72 6f 77 73 65 72 43 65 72 74 73 44 69 61 6c 6f 67 28 53 74 72 69 6e 67 20 73 65 72 76 +.BrowserCertsDialog(String.serv
94e0 2c 20 53 74 72 69 6e 67 20 68 70 29 20 7b 0a 2b 09 09 76 6e 63 53 65 72 76 65 72 20 3d 20 73 65 ,.String.hp).{.+..vncServer.=.se
9500 72 76 3b 0a 2b 09 09 68 6f 73 74 70 6f 72 74 20 3d 20 68 70 3b 0a 2b 09 7d 0a 2b 0a 2b 09 70 75 rv;.+..hostport.=.hp;.+.}.+.+.pu
9520 62 6c 69 63 20 76 6f 69 64 20 71 75 65 72 79 55 73 65 72 28 29 20 7b 0a 2b 0a 2b 09 09 2f 2a 20 blic.void.queryUser().{.+.+../*.
9540 63 72 65 61 74 65 20 61 6e 64 20 64 69 73 70 6c 61 79 20 74 68 65 20 64 69 61 6c 6f 67 20 66 6f create.and.display.the.dialog.fo
9560 72 20 75 6e 76 65 72 69 66 69 65 64 20 63 65 72 74 2e 20 2a 2f 0a 2b 0a 2b 09 09 46 72 61 6d 65 r.unverified.cert..*/.+.+..Frame
9580 20 66 72 61 6d 65 20 3d 20 6e 65 77 20 46 72 61 6d 65 28 22 55 73 65 20 42 72 6f 77 73 65 72 2f .frame.=.new.Frame("Use.Browser/
95a0 4a 56 4d 20 43 65 72 74 73 3f 22 29 3b 0a 2b 0a 2b 09 09 64 69 61 6c 6f 67 20 3d 20 6e 65 77 20 JVM.Certs?");.+.+..dialog.=.new.
95c0 44 69 61 6c 6f 67 28 66 72 61 6d 65 2c 20 74 72 75 65 29 3b 0a 2b 0a 2b 09 09 53 74 72 69 6e 67 Dialog(frame,.true);.+.+..String
95e0 20 6d 20 3d 20 22 22 3b 0a 2b 6d 20 2b 3d 20 22 5c 6e 22 3b 0a 2b 6d 20 2b 3d 20 22 54 68 69 73 .m.=."";.+m.+=."\n";.+m.+=."This
9600 20 56 4e 43 20 56 69 65 77 65 72 20 61 70 70 6c 65 74 20 64 6f 65 73 20 6e 6f 74 20 68 61 76 65 .VNC.Viewer.applet.does.not.have
9620 20 69 74 73 20 6f 77 6e 20 6b 65 79 73 74 6f 72 65 20 74 6f 20 74 72 61 63 6b 5c 6e 22 3b 0a 2b .its.own.keystore.to.track\n";.+
9640 6d 20 2b 3d 20 22 53 53 4c 20 63 65 72 74 69 66 69 63 61 74 65 73 2c 20 61 6e 64 20 73 6f 20 63 m.+=."SSL.certificates,.and.so.c
9660 61 6e 6e 6f 74 20 61 75 74 68 65 6e 74 69 63 61 74 65 20 74 68 65 20 63 65 72 74 69 66 69 63 61 annot.authenticate.the.certifica
9680 74 65 5c 6e 22 3b 0a 2b 6d 20 2b 3d 20 22 6f 66 20 74 68 65 20 56 4e 43 20 53 65 72 76 65 72 3a te\n";.+m.+=."of.the.VNC.Server:
96a0 5c 6e 22 3b 0a 2b 6d 20 2b 3d 20 22 5c 6e 22 3b 0a 2b 6d 20 2b 3d 20 22 20 20 20 20 20 20 20 20 \n";.+m.+=."\n";.+m.+=."........
96c0 22 20 2b 20 68 6f 73 74 70 6f 72 74 20 2b 20 22 5c 6e 5c 6e 20 20 20 20 20 20 20 20 22 20 2b 20 ".+.hostport.+."\n\n........".+.
96e0 76 6e 63 53 65 72 76 65 72 20 2b 20 22 5c 6e 22 3b 0a 2b 6d 20 2b 3d 20 22 5c 6e 22 3b 0a 2b 6d vncServer.+."\n";.+m.+=."\n";.+m
9700 20 2b 3d 20 22 6f 6e 20 69 74 73 20 6f 77 6e 2e 5c 6e 22 3b 0a 2b 6d 20 2b 3d 20 22 5c 6e 22 3b .+=."on.its.own.\n";.+m.+=."\n";
9720 0a 2b 6d 20 2b 3d 20 22 48 6f 77 65 76 65 72 2c 20 69 74 20 68 61 73 20 6e 6f 74 69 63 65 64 20 .+m.+=."However,.it.has.noticed.
9740 74 68 61 74 20 79 6f 75 72 20 57 65 62 20 42 72 6f 77 73 65 72 20 6f 72 20 4a 61 76 61 20 56 4d that.your.Web.Browser.or.Java.VM
9760 20 50 6c 75 67 69 6e 5c 6e 22 3b 0a 2b 6d 20 2b 3d 20 22 68 61 73 20 70 72 65 76 69 6f 75 73 6c .Plugin\n";.+m.+=."has.previousl
9780 79 20 61 63 63 65 70 74 65 64 20 74 68 65 20 73 61 6d 65 20 63 65 72 74 69 66 69 63 61 74 65 2e y.accepted.the.same.certificate.
97a0 20 20 59 6f 75 20 6d 61 79 20 68 61 76 65 20 73 65 74 5c 6e 22 3b 0a 2b 6d 20 2b 3d 20 22 74 68 ..You.may.have.set\n";.+m.+=."th
97c0 69 73 20 75 70 20 70 65 72 6d 61 6e 65 6e 74 6c 79 20 6f 72 20 6a 75 73 74 20 66 6f 72 20 74 68 is.up.permanently.or.just.for.th
97e0 69 73 20 73 65 73 73 69 6f 6e 2c 20 6f 72 20 74 68 65 20 73 65 72 76 65 72 5c 6e 22 3b 0a 2b 6d is.session,.or.the.server\n";.+m
9800 20 2b 3d 20 22 63 65 72 74 69 66 69 63 61 74 65 20 77 61 73 20 73 69 67 6e 65 64 20 62 79 20 61 .+=."certificate.was.signed.by.a
9820 20 43 41 20 63 65 72 74 20 74 68 61 74 20 79 6f 75 72 20 57 65 62 20 42 72 6f 77 73 65 72 20 6f .CA.cert.that.your.Web.Browser.o
9840 72 5c 6e 22 3b 0a 2b 6d 20 2b 3d 20 22 4a 61 76 61 20 56 4d 20 50 6c 75 67 69 6e 20 68 61 73 2e r\n";.+m.+=."Java.VM.Plugin.has.
9860 5c 6e 22 3b 0a 2b 6d 20 2b 3d 20 22 5c 6e 22 3b 0a 2b 6d 20 2b 3d 20 22 53 68 6f 75 6c 64 20 74 \n";.+m.+=."\n";.+m.+=."Should.t
9880 68 69 73 20 56 4e 43 20 56 69 65 77 65 72 20 61 70 70 6c 65 74 20 6e 6f 77 20 63 6f 6e 6e 65 63 his.VNC.Viewer.applet.now.connec
98a0 74 20 74 6f 20 74 68 65 20 61 62 6f 76 65 20 56 4e 43 20 73 65 72 76 65 72 3f 5c 6e 22 3b 0a 2b t.to.the.above.VNC.server?\n";.+
98c0 6d 20 2b 3d 20 22 5c 6e 22 3b 0a 2b 0a 2b 2f 2f 09 09 53 74 72 69 6e 67 20 6d 20 3d 20 22 5c 6e m.+=."\n";.+.+//..String.m.=."\n
98e0 53 68 6f 75 6c 64 20 74 68 69 73 20 56 4e 43 20 56 69 65 77 65 72 20 61 70 70 6c 65 74 20 75 73 Should.this.VNC.Viewer.applet.us
9900 65 20 79 6f 75 72 20 42 72 6f 77 73 65 72 2f 4a 56 4d 20 63 65 72 74 73 20 74 6f 5c 6e 22 3b 0a e.your.Browser/JVM.certs.to\n";.
9920 2b 2f 2f 09 09 6d 20 2b 3d 20 22 61 75 74 68 65 6e 74 69 63 61 74 65 20 74 68 65 20 56 4e 43 20 +//..m.+=."authenticate.the.VNC.
9940 53 65 72 76 65 72 3a 5c 6e 22 3b 0a 2b 2f 2f 09 09 6d 20 2b 3d 20 22 5c 6e 20 20 20 20 20 20 20 Server:\n";.+//..m.+=."\n.......
9960 20 22 20 2b 20 68 6f 73 74 70 6f 72 74 20 2b 20 22 5c 6e 5c 6e 20 20 20 20 20 20 20 20 22 20 2b .".+.hostport.+."\n\n........".+
9980 20 76 6e 63 53 65 72 76 65 72 20 2b 20 22 5c 6e 5c 6e 22 3b 20 20 20 20 0a 2b 2f 2f 09 09 6d 20 .vncServer.+."\n\n";.....+//..m.
99a0 2b 3d 20 22 28 4e 4f 54 45 3a 20 74 68 69 73 20 2a 69 6e 63 6c 75 64 65 73 2a 20 61 6e 79 20 63 +=."(NOTE:.this.*includes*.any.c
99c0 65 72 74 73 20 79 6f 75 20 68 61 76 65 20 4a 75 73 74 20 4e 6f 77 20 61 63 63 65 70 74 65 64 20 erts.you.have.Just.Now.accepted.
99e0 69 6e 20 61 5c 6e 22 3b 0a 2b 2f 2f 09 09 6d 20 2b 3d 20 22 64 69 61 6c 6f 67 20 62 6f 78 20 77 in.a\n";.+//..m.+=."dialog.box.w
9a00 69 74 68 20 79 6f 75 72 20 57 65 62 20 42 72 6f 77 73 65 72 20 6f 72 20 4a 61 76 61 20 41 70 70 ith.your.Web.Browser.or.Java.App
9a20 6c 65 74 20 50 6c 75 67 69 6e 29 5c 6e 5c 6e 22 3b 0a 2b 0a 2b 09 09 54 65 78 74 41 72 65 61 20 let.Plugin)\n\n";.+.+..TextArea.
9a40 74 65 78 74 61 72 65 61 20 3d 20 6e 65 77 20 54 65 78 74 41 72 65 61 28 6d 2c 20 32 30 2c 20 36 textarea.=.new.TextArea(m,.20,.6
9a60 34 2c 0a 2b 09 09 20 20 20 20 54 65 78 74 41 72 65 61 2e 53 43 52 4f 4c 4c 42 41 52 53 5f 56 45 4,.+......TextArea.SCROLLBARS_VE
9a80 52 54 49 43 41 4c 5f 4f 4e 4c 59 29 3b 0a 2b 09 09 74 65 78 74 61 72 65 61 2e 73 65 74 45 64 69 RTICAL_ONLY);.+..textarea.setEdi
9aa0 74 61 62 6c 65 28 66 61 6c 73 65 29 3b 0a 2b 09 09 79 65 73 20 3d 20 6e 65 77 20 42 75 74 74 6f table(false);.+..yes.=.new.Butto
9ac0 6e 28 22 59 65 73 22 29 3b 0a 2b 09 09 79 65 73 2e 61 64 64 41 63 74 69 6f 6e 4c 69 73 74 65 6e n("Yes");.+..yes.addActionListen
9ae0 65 72 28 74 68 69 73 29 3b 0a 2b 09 09 6e 6f 20 3d 20 6e 65 77 20 42 75 74 74 6f 6e 28 22 4e 6f er(this);.+..no.=.new.Button("No
9b00 2c 20 4c 65 74 20 4d 65 20 53 65 65 20 74 68 65 20 43 65 72 74 69 66 69 63 61 74 65 2e 22 29 3b ,.Let.Me.See.the.Certificate.");
9b20 0a 2b 09 09 6e 6f 2e 61 64 64 41 63 74 69 6f 6e 4c 69 73 74 65 6e 65 72 28 74 68 69 73 29 3b 0a .+..no.addActionListener(this);.
9b40 2b 0a 2b 09 09 64 69 61 6c 6f 67 2e 73 65 74 4c 61 79 6f 75 74 28 6e 65 77 20 42 6f 72 64 65 72 +.+..dialog.setLayout(new.Border
9b60 4c 61 79 6f 75 74 28 29 29 3b 0a 2b 09 09 64 69 61 6c 6f 67 2e 61 64 64 28 22 4e 6f 72 74 68 22 Layout());.+..dialog.add("North"
9b80 2c 20 74 65 78 74 61 72 65 61 29 3b 0a 2b 09 09 64 69 61 6c 6f 67 2e 61 64 64 28 22 43 65 6e 74 ,.textarea);.+..dialog.add("Cent
9ba0 65 72 22 2c 20 79 65 73 29 3b 0a 2b 09 09 64 69 61 6c 6f 67 2e 61 64 64 28 22 53 6f 75 74 68 22 er",.yes);.+..dialog.add("South"
9bc0 2c 20 6e 6f 29 3b 0a 2b 09 09 64 69 61 6c 6f 67 2e 70 61 63 6b 28 29 3b 0a 2b 09 09 64 69 61 6c ,.no);.+..dialog.pack();.+..dial
9be0 6f 67 2e 72 65 73 69 7a 65 28 64 69 61 6c 6f 67 2e 70 72 65 66 65 72 72 65 64 53 69 7a 65 28 29 og.resize(dialog.preferredSize()
9c00 29 3b 0a 2b 0a 2b 09 09 64 69 61 6c 6f 67 2e 73 68 6f 77 28 29 3b 09 2f 2a 20 62 6c 6f 63 6b 20 );.+.+..dialog.show();./*.block.
9c20 68 65 72 65 20 74 69 6c 20 59 65 73 20 6f 72 20 4e 6f 20 70 72 65 73 73 65 64 2e 20 2a 2f 0a 2b here.til.Yes.or.No.pressed..*/.+
9c40 09 09 72 65 74 75 72 6e 3b 0a 2b 09 7d 0a 2b 0a 2b 09 70 75 62 6c 69 63 20 73 79 6e 63 68 72 6f ..return;.+.}.+.+.public.synchro
9c60 6e 69 7a 65 64 20 76 6f 69 64 20 61 63 74 69 6f 6e 50 65 72 66 6f 72 6d 65 64 28 41 63 74 69 6f nized.void.actionPerformed(Actio
9c80 6e 45 76 65 6e 74 20 65 76 74 29 20 7b 0a 2b 09 09 53 79 73 74 65 6d 2e 6f 75 74 2e 70 72 69 6e nEvent.evt).{.+..System.out.prin
9ca0 74 6c 6e 28 65 76 74 2e 67 65 74 41 63 74 69 6f 6e 43 6f 6d 6d 61 6e 64 28 29 29 3b 0a 2b 09 09 tln(evt.getActionCommand());.+..
9cc0 69 66 20 28 65 76 74 2e 67 65 74 53 6f 75 72 63 65 28 29 20 3d 3d 20 79 65 73 29 20 7b 0a 2b 09 if.(evt.getSource().==.yes).{.+.
9ce0 09 09 73 68 6f 77 43 65 72 74 44 69 61 6c 6f 67 20 3d 20 66 61 6c 73 65 3b 0a 2b 09 09 09 64 69 ..showCertDialog.=.false;.+...di
9d00 61 6c 6f 67 2e 64 69 73 70 6f 73 65 28 29 3b 0a 2b 09 09 7d 20 65 6c 73 65 20 69 66 20 28 65 76 alog.dispose();.+..}.else.if.(ev
9d20 74 2e 67 65 74 53 6f 75 72 63 65 28 29 20 3d 3d 20 6e 6f 29 20 7b 0a 2b 09 09 09 73 68 6f 77 43 t.getSource().==.no).{.+...showC
9d40 65 72 74 44 69 61 6c 6f 67 20 3d 20 74 72 75 65 3b 0a 2b 09 09 09 64 69 61 6c 6f 67 2e 64 69 73 ertDialog.=.true;.+...dialog.dis
9d60 70 6f 73 65 28 29 3b 0a 2b 09 09 7d 0a 2b 09 7d 0a 2b 7d 0a 2b 0a 2b 63 6c 61 73 73 20 43 65 72 pose();.+..}.+.}.+}.+.+class.Cer
9d80 74 49 6e 66 6f 20 7b 0a 2b 09 53 74 72 69 6e 67 20 66 69 65 6c 64 73 5b 5d 20 3d 20 7b 22 43 4e tInfo.{.+.String.fields[].=.{"CN
9da0 22 2c 20 22 4f 55 22 2c 20 22 4f 22 2c 20 22 4c 22 2c 20 22 43 22 7d 3b 0a 2b 09 6a 61 76 61 2e ",."OU",."O",."L",."C"};.+.java.
9dc0 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 43 65 72 74 69 66 69 63 61 74 65 20 63 65 72 74 3b 0a security.cert.Certificate.cert;.
9de0 2b 09 53 74 72 69 6e 67 20 63 65 72 74 53 74 72 69 6e 67 20 3d 20 22 22 3b 0a 2b 0a 2b 09 43 65 +.String.certString.=."";.+.+.Ce
9e00 72 74 49 6e 66 6f 28 6a 61 76 61 2e 73 65 63 75 72 69 74 79 2e 63 65 72 74 2e 43 65 72 74 69 66 rtInfo(java.security.cert.Certif
9e20 69 63 61 74 65 20 63 29 20 7b 0a 2b 09 09 63 65 72 74 20 3d 20 63 3b 0a 2b 09 09 63 65 72 74 53 icate.c).{.+..cert.=.c;.+..certS
9e40 74 72 69 6e 67 20 3d 20 63 65 72 74 2e 74 6f 53 74 72 69 6e 67 28 29 3b 0a 2b 09 7d 0a 2b 09 0a tring.=.cert.toString();.+.}.+..
9e60 2b 09 53 74 72 69 6e 67 20 67 65 74 5f 63 65 72 74 69 6e 66 6f 28 53 74 72 69 6e 67 20 77 68 69 +.String.get_certinfo(String.whi
9e80 63 68 29 20 7b 0a 2b 09 09 69 6e 74 20 69 3b 0a 2b 09 09 53 74 72 69 6e 67 20 63 73 20 3d 20 6e ch).{.+..int.i;.+..String.cs.=.n
9ea0 65 77 20 53 74 72 69 6e 67 28 63 65 72 74 53 74 72 69 6e 67 29 3b 0a 2b 09 09 53 74 72 69 6e 67 ew.String(certString);.+..String
9ec0 20 61 6c 6c 20 3d 20 22 22 3b 0a 2b 0a 2b 09 09 2f 2a 0a 2b 09 09 20 2a 20 46 6f 72 20 6e 6f 77 .all.=."";.+.+../*.+...*.For.now
9ee0 20 77 65 20 73 69 6d 70 6c 79 20 73 63 72 61 70 65 20 74 68 65 20 63 65 72 74 20 73 74 72 69 6e .we.simply.scrape.the.cert.strin
9f00 67 2c 20 74 68 65 72 65 20 6d 75 73 74 0a 2b 09 09 20 2a 20 62 65 20 61 6e 20 41 50 49 20 66 6f g,.there.must.+...*.be.an.API.fo
9f20 72 20 74 68 69 73 2e 2e 2e 20 70 65 72 68 61 70 73 20 6f 70 74 69 6f 6e 56 61 6c 75 65 3f 0a 2b r.this....perhaps.optionValue?.+
9f40 09 09 20 2a 2f 0a 2b 09 09 66 6f 72 20 28 69 3d 30 3b 20 69 20 3c 20 66 69 65 6c 64 73 2e 6c 65 ...*/.+..for.(i=0;.i.<.fields.le
9f60 6e 67 74 68 3b 20 69 2b 2b 29 20 7b 0a 2b 09 09 09 69 6e 74 20 66 2c 20 74 2c 20 74 31 2c 20 74 ngth;.i++).{.+...int.f,.t,.t1,.t
9f80 32 3b 0a 2b 09 09 09 53 74 72 69 6e 67 20 73 75 62 2c 20 6d 61 74 20 3d 20 66 69 65 6c 64 73 5b 2;.+...String.sub,.mat.=.fields[
9fa0 69 5d 20 2b 20 22 3d 22 3b 0a 2b 09 09 09 0a 2b 09 09 09 66 20 3d 20 63 73 2e 69 6e 64 65 78 4f i].+."=";.+....+...f.=.cs.indexO
9fc0 66 28 6d 61 74 2c 20 30 29 3b 0a 2b 09 09 09 69 66 20 28 66 20 3e 20 30 29 20 7b 0a 2b 09 09 09 f(mat,.0);.+...if.(f.>.0).{.+...
9fe0 09 74 31 20 3d 20 63 73 2e 69 6e 64 65 78 4f 66 28 22 2c 20 22 2c 20 66 29 3b 0a 2b 09 09 09 09 .t1.=.cs.indexOf(",.",.f);.+....
a000 74 32 20 3d 20 63 73 2e 69 6e 64 65 78 4f 66 28 22 5c 6e 22 2c 20 66 29 3b 0a 2b 09 09 09 09 69 t2.=.cs.indexOf("\n",.f);.+....i
a020 66 20 28 74 31 20 3c 20 30 20 26 26 20 74 32 20 3c 20 30 29 20 7b 0a 2b 09 09 09 09 09 63 6f 6e f.(t1.<.0.&&.t2.<.0).{.+.....con
a040 74 69 6e 75 65 3b 0a 2b 09 09 09 09 7d 20 65 6c 73 65 20 69 66 20 28 74 31 20 3c 20 30 29 20 7b tinue;.+....}.else.if.(t1.<.0).{
a060 0a 2b 09 09 09 09 09 74 20 3d 20 74 32 3b 0a 2b 09 09 09 09 7d 20 65 6c 73 65 20 69 66 20 28 74 .+.....t.=.t2;.+....}.else.if.(t
a080 32 20 3c 20 30 29 20 7b 0a 2b 09 09 09 09 09 74 20 3d 20 74 31 3b 0a 2b 09 09 09 09 7d 20 65 6c 2.<.0).{.+.....t.=.t1;.+....}.el
a0a0 73 65 20 69 66 20 28 74 31 20 3c 20 74 32 29 20 7b 0a 2b 09 09 09 09 09 74 20 3d 20 74 31 3b 0a se.if.(t1.<.t2).{.+.....t.=.t1;.
a0c0 2b 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 09 09 74 20 3d 20 74 32 3b 0a 2b 09 09 09 +....}.else.{.+.....t.=.t2;.+...
a0e0 09 7d 0a 2b 09 09 09 09 69 66 20 28 74 20 3e 20 66 29 20 7b 0a 2b 09 09 09 09 09 73 75 62 20 3d .}.+....if.(t.>.f).{.+.....sub.=
a100 20 63 73 2e 73 75 62 73 74 72 69 6e 67 28 66 2c 20 74 29 3b 0a 2b 09 09 09 09 09 61 6c 6c 20 3d .cs.substring(f,.t);.+.....all.=
a120 20 61 6c 6c 20 2b 20 22 20 20 20 20 20 20 20 20 22 20 2b 20 73 75 62 20 2b 20 22 5c 6e 22 3b 0a .all.+."........".+.sub.+."\n";.
a140 2b 09 09 09 09 09 69 66 20 28 77 68 69 63 68 2e 65 71 75 61 6c 73 28 66 69 65 6c 64 73 5b 69 5d +.....if.(which.equals(fields[i]
a160 29 29 20 7b 0a 2b 09 09 09 09 09 09 72 65 74 75 72 6e 20 73 75 62 3b 0a 2b 09 09 09 09 09 7d 0a )).{.+......return.sub;.+.....}.
a180 2b 09 09 09 09 7d 0a 2b 09 09 09 7d 0a 2b 09 09 7d 0a 2b 09 09 69 66 20 28 77 68 69 63 68 2e 65 +....}.+...}.+..}.+..if.(which.e
a1a0 71 75 61 6c 73 28 22 61 6c 6c 22 29 29 20 7b 0a 2b 09 09 09 72 65 74 75 72 6e 20 61 6c 6c 3b 0a quals("all")).{.+...return.all;.
a1c0 2b 09 09 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 72 65 74 75 72 6e 20 22 22 3b 0a 2b 09 09 7d 0a +..}.else.{.+...return."";.+..}.
a1e0 2b 09 7d 0a 2b 7d 0a 64 69 66 66 20 2d 78 20 56 6e 63 43 61 6e 76 61 73 2e 6a 61 76 61 20 2d 4e +.}.+}.diff.-x.VncCanvas.java.-N
a200 61 75 72 20 76 6e 63 5f 6a 61 76 61 73 72 63 2e 6f 72 69 67 2f 56 6e 63 56 69 65 77 65 72 2e 6a aur.vnc_javasrc.orig/VncViewer.j
a220 61 76 61 20 76 6e 63 5f 6a 61 76 61 73 72 63 2f 56 6e 63 56 69 65 77 65 72 2e 6a 61 76 61 0a 2d ava.vnc_javasrc/VncViewer.java.-
a240 2d 2d 20 76 6e 63 5f 6a 61 76 61 73 72 63 2e 6f 72 69 67 2f 56 6e 63 56 69 65 77 65 72 2e 6a 61 --.vnc_javasrc.orig/VncViewer.ja
a260 76 61 09 32 30 30 34 2d 30 33 2d 30 34 20 30 38 3a 33 34 3a 32 35 2e 30 30 30 30 30 30 30 30 30 va.2004-03-04.08:34:25.000000000
a280 20 2d 30 35 30 30 0a 2b 2b 2b 20 76 6e 63 5f 6a 61 76 61 73 72 63 2f 56 6e 63 56 69 65 77 65 72 .-0500.+++.vnc_javasrc/VncViewer
a2a0 2e 6a 61 76 61 09 32 30 30 37 2d 30 33 2d 33 31 20 32 33 3a 33 35 3a 32 36 2e 30 30 30 30 30 30 .java.2007-03-31.23:35:26.000000
a2c0 30 30 30 20 2d 30 34 30 30 0a 40 40 20 2d 38 38 2c 36 20 2b 38 38 2c 31 37 20 40 40 0a 20 20 20 000.-0400.@@.-88,6.+88,17.@@....
a2e0 69 6e 74 20 64 65 66 65 72 43 75 72 73 6f 72 55 70 64 61 74 65 73 3b 0a 20 20 20 69 6e 74 20 64 int.deferCursorUpdates;....int.d
a300 65 66 65 72 55 70 64 61 74 65 52 65 71 75 65 73 74 73 3b 0a 20 0a 2b 20 20 62 6f 6f 6c 65 61 6e eferUpdateRequests;...+..boolean
a320 20 64 69 73 61 62 6c 65 53 53 4c 3b 0a 2b 20 20 62 6f 6f 6c 65 61 6e 20 47 45 54 3b 0a 2b 20 20 .disableSSL;.+..boolean.GET;.+..
a340 53 74 72 69 6e 67 20 43 4f 4e 4e 45 43 54 3b 0a 2b 20 20 53 74 72 69 6e 67 20 75 72 6c 50 72 65 String.CONNECT;.+..String.urlPre
a360 66 69 78 3b 0a 2b 20 20 53 74 72 69 6e 67 20 68 74 74 70 73 50 6f 72 74 3b 0a 2b 20 20 53 74 72 fix;.+..String.httpsPort;.+..Str
a380 69 6e 67 20 6f 6e 65 54 69 6d 65 4b 65 79 3b 0a 2b 20 20 62 6f 6f 6c 65 61 6e 20 66 6f 72 63 65 ing.oneTimeKey;.+..boolean.force
a3a0 50 72 6f 78 79 3b 0a 2b 20 20 62 6f 6f 6c 65 61 6e 20 69 67 6e 6f 72 65 50 72 6f 78 79 3b 0a 2b Proxy;.+..boolean.ignoreProxy;.+
a3c0 20 20 62 6f 6f 6c 65 61 6e 20 74 72 75 73 74 41 6c 6c 56 6e 63 43 65 72 74 73 3b 0a 2b 20 20 62 ..boolean.trustAllVncCerts;.+..b
a3e0 6f 6f 6c 65 61 6e 20 74 72 75 73 74 55 72 6c 56 6e 63 43 65 72 74 3b 0a 2b 0a 20 20 20 2f 2f 20 oolean.trustUrlVncCert;.+....//.
a400 52 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 69 73 20 61 70 70 6c 65 74 20 66 6f 72 20 69 6e 74 Reference.to.this.applet.for.int
a420 65 72 2d 61 70 70 6c 65 74 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 2e 0a 20 20 20 70 75 62 6c er-applet.communication.....publ
a440 69 63 20 73 74 61 74 69 63 20 6a 61 76 61 2e 61 70 70 6c 65 74 2e 41 70 70 6c 65 74 20 72 65 66 ic.static.java.applet.Applet.ref
a460 41 70 70 6c 65 74 3b 0a 20 0a 40 40 20 2d 36 32 36 2c 36 20 2b 36 33 37 2c 36 38 20 40 40 0a 20 Applet;...@@.-626,6.+637,68.@@..
a480 0a 20 20 20 20 20 2f 2f 20 53 6f 63 6b 65 74 46 61 63 74 6f 72 79 2e 0a 20 20 20 20 20 73 6f 63 ......//.SocketFactory.......soc
a4a0 6b 65 74 46 61 63 74 6f 72 79 20 3d 20 72 65 61 64 50 61 72 61 6d 65 74 65 72 28 22 53 6f 63 6b ketFactory.=.readParameter("Sock
a4c0 65 74 46 61 63 74 6f 72 79 22 2c 20 66 61 6c 73 65 29 3b 0a 2b 0a 2b 20 20 20 20 2f 2f 20 53 53 etFactory",.false);.+.+....//.SS
a4e0 4c 0a 2b 20 20 20 20 64 69 73 61 62 6c 65 53 53 4c 20 3d 20 66 61 6c 73 65 3b 0a 2b 20 20 20 20 L.+....disableSSL.=.false;.+....
a500 73 74 72 20 3d 20 72 65 61 64 50 61 72 61 6d 65 74 65 72 28 22 44 69 73 61 62 6c 65 53 53 4c 22 str.=.readParameter("DisableSSL"
a520 2c 20 66 61 6c 73 65 29 3b 0a 2b 20 20 20 20 69 66 20 28 73 74 72 20 21 3d 20 6e 75 6c 6c 20 26 ,.false);.+....if.(str.!=.null.&
a540 26 20 73 74 72 2e 65 71 75 61 6c 73 49 67 6e 6f 72 65 43 61 73 65 28 22 59 65 73 22 29 29 0a 2b &.str.equalsIgnoreCase("Yes")).+
a560 20 20 20 20 20 20 64 69 73 61 62 6c 65 53 53 4c 20 3d 20 74 72 75 65 3b 0a 2b 0a 2b 20 20 20 20 ......disableSSL.=.true;.+.+....
a580 68 74 74 70 73 50 6f 72 74 20 3d 20 72 65 61 64 50 61 72 61 6d 65 74 65 72 28 22 68 74 74 70 73 httpsPort.=.readParameter("https
a5a0 50 6f 72 74 22 2c 20 66 61 6c 73 65 29 3b 0a 2b 0a 2b 20 20 20 20 2f 2f 20 45 78 74 72 61 20 47 Port",.false);.+.+....//.Extra.G
a5c0 45 54 2c 20 43 4f 4e 4e 45 43 54 20 73 74 72 69 6e 67 3a 0a 2b 20 20 20 20 43 4f 4e 4e 45 43 54 ET,.CONNECT.string:.+....CONNECT
a5e0 20 3d 20 72 65 61 64 50 61 72 61 6d 65 74 65 72 28 22 43 4f 4e 4e 45 43 54 22 2c 20 66 61 6c 73 .=.readParameter("CONNECT",.fals
a600 65 29 3b 0a 2b 20 20 20 20 69 66 20 28 43 4f 4e 4e 45 43 54 20 21 3d 20 6e 75 6c 6c 29 20 7b 0a e);.+....if.(CONNECT.!=.null).{.
a620 2b 09 43 4f 4e 4e 45 43 54 20 3d 20 43 4f 4e 4e 45 43 54 2e 72 65 70 6c 61 63 65 41 6c 6c 28 22 +.CONNECT.=.CONNECT.replaceAll("
a640 20 22 2c 20 22 3a 22 29 3b 0a 2b 20 20 20 20 7d 0a 2b 0a 2b 20 20 20 20 47 45 54 20 3d 20 66 61 .",.":");.+....}.+.+....GET.=.fa
a660 6c 73 65 3b 0a 2b 20 20 20 20 73 74 72 20 3d 20 72 65 61 64 50 61 72 61 6d 65 74 65 72 28 22 47 lse;.+....str.=.readParameter("G
a680 45 54 22 2c 20 66 61 6c 73 65 29 3b 0a 2b 20 20 20 20 69 66 20 28 73 74 72 20 21 3d 20 6e 75 6c ET",.false);.+....if.(str.!=.nul
a6a0 6c 20 26 26 20 73 74 72 2e 65 71 75 61 6c 73 49 67 6e 6f 72 65 43 61 73 65 28 22 59 65 73 22 29 l.&&.str.equalsIgnoreCase("Yes")
a6c0 29 20 7b 0a 2b 20 20 20 20 20 20 47 45 54 20 3d 20 74 72 75 65 3b 0a 2b 20 20 20 20 7d 0a 2b 20 ).{.+......GET.=.true;.+....}.+.
a6e0 20 20 20 69 66 20 28 73 74 72 20 21 3d 20 6e 75 6c 6c 20 26 26 20 73 74 72 2e 65 71 75 61 6c 73 ...if.(str.!=.null.&&.str.equals
a700 49 67 6e 6f 72 65 43 61 73 65 28 22 31 22 29 29 20 7b 0a 2b 20 20 20 20 20 20 47 45 54 20 3d 20 IgnoreCase("1")).{.+......GET.=.
a720 74 72 75 65 3b 0a 2b 20 20 20 20 7d 0a 2b 0a 2b 20 20 20 20 75 72 6c 50 72 65 66 69 78 20 3d 20 true;.+....}.+.+....urlPrefix.=.
a740 72 65 61 64 50 61 72 61 6d 65 74 65 72 28 22 75 72 6c 50 72 65 66 69 78 22 2c 20 66 61 6c 73 65 readParameter("urlPrefix",.false
a760 29 3b 0a 2b 20 20 20 20 69 66 20 28 75 72 6c 50 72 65 66 69 78 20 21 3d 20 6e 75 6c 6c 29 20 7b );.+....if.(urlPrefix.!=.null).{
a780 0a 2b 09 75 72 6c 50 72 65 66 69 78 20 3d 20 75 72 6c 50 72 65 66 69 78 2e 72 65 70 6c 61 63 65 .+.urlPrefix.=.urlPrefix.replace
a7a0 41 6c 6c 28 22 25 32 46 22 2c 20 22 2f 22 29 3b 0a 2b 09 75 72 6c 50 72 65 66 69 78 20 3d 20 75 All("%2F",."/");.+.urlPrefix.=.u
a7c0 72 6c 50 72 65 66 69 78 2e 72 65 70 6c 61 63 65 41 6c 6c 28 22 25 32 66 22 2c 20 22 2f 22 29 3b rlPrefix.replaceAll("%2f",."/");
a7e0 0a 2b 09 75 72 6c 50 72 65 66 69 78 20 3d 20 75 72 6c 50 72 65 66 69 78 2e 72 65 70 6c 61 63 65 .+.urlPrefix.=.urlPrefix.replace
a800 41 6c 6c 28 22 5f 32 46 5f 22 2c 20 22 2f 22 29 3b 0a 2b 09 69 66 20 28 75 72 6c 50 72 65 66 69 All("_2F_",."/");.+.if.(urlPrefi
a820 78 2e 69 6e 64 65 78 4f 66 28 22 2f 22 29 20 21 3d 20 30 29 20 7b 0a 2b 09 09 75 72 6c 50 72 65 x.indexOf("/").!=.0).{.+..urlPre
a840 66 69 78 20 3d 20 22 2f 22 20 2b 20 75 72 6c 50 72 65 66 69 78 3b 0a 2b 09 7d 0a 2b 20 20 20 20 fix.=."/".+.urlPrefix;.+.}.+....
a860 7d 20 65 6c 73 65 20 7b 0a 2b 20 20 20 20 09 75 72 6c 50 72 65 66 69 78 20 3d 20 22 22 3b 0a 2b }.else.{.+.....urlPrefix.=."";.+
a880 20 20 20 20 7d 0a 2b 20 20 20 20 53 79 73 74 65 6d 2e 6f 75 74 2e 70 72 69 6e 74 6c 6e 28 22 75 ....}.+....System.out.println("u
a8a0 72 6c 50 72 65 66 69 78 3a 20 27 22 20 2b 20 75 72 6c 50 72 65 66 69 78 20 2b 20 22 27 22 29 3b rlPrefix:.'".+.urlPrefix.+."'");
a8c0 0a 2b 0a 2b 20 20 20 20 6f 6e 65 54 69 6d 65 4b 65 79 20 3d 20 72 65 61 64 50 61 72 61 6d 65 74 .+.+....oneTimeKey.=.readParamet
a8e0 65 72 28 22 6f 6e 65 54 69 6d 65 4b 65 79 22 2c 20 66 61 6c 73 65 29 3b 0a 2b 20 20 20 20 69 66 er("oneTimeKey",.false);.+....if
a900 20 28 6f 6e 65 54 69 6d 65 4b 65 79 20 21 3d 20 6e 75 6c 6c 29 20 7b 0a 2b 20 20 20 20 09 53 79 .(oneTimeKey.!=.null).{.+.....Sy
a920 73 74 65 6d 2e 6f 75 74 2e 70 72 69 6e 74 6c 6e 28 22 6f 6e 65 54 69 6d 65 4b 65 79 3a 20 69 73 stem.out.println("oneTimeKey:.is
a940 20 73 65 74 22 29 3b 0a 2b 20 20 20 20 7d 0a 2b 0a 2b 20 20 20 20 66 6f 72 63 65 50 72 6f 78 79 .set");.+....}.+.+....forceProxy
a960 20 3d 20 66 61 6c 73 65 3b 0a 2b 20 20 20 20 73 74 72 20 3d 20 72 65 61 64 50 61 72 61 6d 65 74 .=.false;.+....str.=.readParamet
a980 65 72 28 22 66 6f 72 63 65 50 72 6f 78 79 22 2c 20 66 61 6c 73 65 29 3b 0a 2b 20 20 20 20 69 66 er("forceProxy",.false);.+....if
a9a0 20 28 73 74 72 20 21 3d 20 6e 75 6c 6c 20 26 26 20 73 74 72 2e 65 71 75 61 6c 73 49 67 6e 6f 72 .(str.!=.null.&&.str.equalsIgnor
a9c0 65 43 61 73 65 28 22 59 65 73 22 29 29 20 7b 0a 2b 09 66 6f 72 63 65 50 72 6f 78 79 20 3d 20 74 eCase("Yes")).{.+.forceProxy.=.t
a9e0 72 75 65 3b 0a 2b 20 20 20 20 7d 0a 2b 20 20 20 20 69 67 6e 6f 72 65 50 72 6f 78 79 20 3d 20 66 rue;.+....}.+....ignoreProxy.=.f
aa00 61 6c 73 65 3b 0a 2b 20 20 20 20 73 74 72 20 3d 20 72 65 61 64 50 61 72 61 6d 65 74 65 72 28 22 alse;.+....str.=.readParameter("
aa20 69 67 6e 6f 72 65 50 72 6f 78 79 22 2c 20 66 61 6c 73 65 29 3b 0a 2b 20 20 20 20 69 66 20 28 73 ignoreProxy",.false);.+....if.(s
aa40 74 72 20 21 3d 20 6e 75 6c 6c 20 26 26 20 73 74 72 2e 65 71 75 61 6c 73 49 67 6e 6f 72 65 43 61 tr.!=.null.&&.str.equalsIgnoreCa
aa60 73 65 28 22 59 65 73 22 29 29 20 7b 0a 2b 09 69 67 6e 6f 72 65 50 72 6f 78 79 20 3d 20 74 72 75 se("Yes")).{.+.ignoreProxy.=.tru
aa80 65 3b 0a 2b 20 20 20 20 7d 0a 2b 20 20 20 20 74 72 75 73 74 41 6c 6c 56 6e 63 43 65 72 74 73 20 e;.+....}.+....trustAllVncCerts.
aaa0 3d 20 66 61 6c 73 65 3b 0a 2b 20 20 20 20 73 74 72 20 3d 20 72 65 61 64 50 61 72 61 6d 65 74 65 =.false;.+....str.=.readParamete
aac0 72 28 22 74 72 75 73 74 41 6c 6c 56 6e 63 43 65 72 74 73 22 2c 20 66 61 6c 73 65 29 3b 0a 2b 20 r("trustAllVncCerts",.false);.+.
aae0 20 20 20 69 66 20 28 73 74 72 20 21 3d 20 6e 75 6c 6c 20 26 26 20 73 74 72 2e 65 71 75 61 6c 73 ...if.(str.!=.null.&&.str.equals
ab00 49 67 6e 6f 72 65 43 61 73 65 28 22 59 65 73 22 29 29 20 7b 0a 2b 09 74 72 75 73 74 41 6c 6c 56 IgnoreCase("Yes")).{.+.trustAllV
ab20 6e 63 43 65 72 74 73 20 3d 20 74 72 75 65 3b 0a 2b 20 20 20 20 7d 0a 2b 20 20 20 20 74 72 75 73 ncCerts.=.true;.+....}.+....trus
ab40 74 55 72 6c 56 6e 63 43 65 72 74 20 3d 20 66 61 6c 73 65 3b 0a 2b 20 20 20 20 73 74 72 20 3d 20 tUrlVncCert.=.false;.+....str.=.
ab60 72 65 61 64 50 61 72 61 6d 65 74 65 72 28 22 74 72 75 73 74 55 72 6c 56 6e 63 43 65 72 74 22 2c readParameter("trustUrlVncCert",
ab80 20 66 61 6c 73 65 29 3b 0a 2b 20 20 20 20 69 66 20 28 73 74 72 20 21 3d 20 6e 75 6c 6c 20 26 26 .false);.+....if.(str.!=.null.&&
aba0 20 73 74 72 2e 65 71 75 61 6c 73 49 67 6e 6f 72 65 43 61 73 65 28 22 59 65 73 22 29 29 20 7b 0a .str.equalsIgnoreCase("Yes")).{.
abc0 2b 09 74 72 75 73 74 55 72 6c 56 6e 63 43 65 72 74 20 3d 20 74 72 75 65 3b 0a 2b 20 20 20 20 7d +.trustUrlVncCert.=.true;.+....}
abe0 0a 20 20 20 7d 0a 20 0a 20 20 20 70 75 62 6c 69 63 20 53 74 72 69 6e 67 20 72 65 61 64 50 61 72 ....}......public.String.readPar
ac00 61 6d 65 74 65 72 28 53 74 72 69 6e 67 20 6e 61 6d 65 2c 20 62 6f 6f 6c 65 61 6e 20 72 65 71 75 ameter(String.name,.boolean.requ
ac20 69 72 65 64 29 20 7b 0a ired).{.