equal
deleted
inserted
replaced
29 * It is used by the TunnelThroughProxy test. |
29 * It is used by the TunnelThroughProxy test. |
30 */ |
30 */ |
31 |
31 |
32 import java.io.*; |
32 import java.io.*; |
33 import java.net.*; |
33 import java.net.*; |
|
34 import java.util.Base64; |
34 import javax.net.ssl.*; |
35 import javax.net.ssl.*; |
35 import javax.net.ServerSocketFactory; |
36 import javax.net.ServerSocketFactory; |
36 import sun.net.www.*; |
37 import sun.net.www.*; |
37 |
38 |
38 public class ProxyTunnelServer extends Thread { |
39 public class ProxyTunnelServer extends Thread { |
293 authInfo.trim(); |
294 authInfo.trim(); |
294 int ind = authInfo.indexOf(' '); |
295 int ind = authInfo.indexOf(' '); |
295 String recvdUserPlusPass = authInfo.substring(ind + 1).trim(); |
296 String recvdUserPlusPass = authInfo.substring(ind + 1).trim(); |
296 // extract encoded (username:passwd |
297 // extract encoded (username:passwd |
297 if (userPlusPass.equals( |
298 if (userPlusPass.equals( |
298 new String( |
299 new String(Base64.getDecoder().decode(recvdUserPlusPass)) |
299 (new sun.misc.BASE64Decoder()). |
300 )) { |
300 decodeBuffer(recvdUserPlusPass) |
|
301 ))) { |
|
302 matched = true; |
301 matched = true; |
303 } |
302 } |
304 } catch (Exception e) { |
303 } catch (Exception e) { |
305 throw new IOException( |
304 throw new IOException( |
306 "Proxy received invalid Proxy-Authorization value: " |
305 "Proxy received invalid Proxy-Authorization value: " |