@Override public void setProxyChallengeResponse(ChallengeResponse response) { super.setProxyChallengeResponse(response); this.proxySecurityAdded = true; }
/** * Sets the authentication response sent by a client to a proxy. * * @param response * The authentication response sent by a client to a proxy. */ @Override public void setProxyChallengeResponse(ChallengeResponse response) { getWrappedRequest().setProxyChallengeResponse(response); }
/** * Sets the proxy authentication response sent by a client to an origin * server. * * @param challengeResponse * The proxy authentication response sent by a client to an * origin server. * @see Request#setProxyChallengeResponse(ChallengeResponse) */ public void setProxyChallengeResponse(ChallengeResponse challengeResponse) { getRequest().setProxyChallengeResponse(challengeResponse); }
/** * @param args * @throws Exception */ public static void main(String[] args) throws Exception { Client sdcClient = new Client(new Context(), Protocol.valueOf("SDC")); Series<Parameter> parameters = sdcClient.getContext().getParameters(); parameters.add("keystorePath", "sdc.keystore"); parameters.add("keystorePassword", "password"); parameters.add("enabledCipherSuites", "TLS_RSA_WITH_AES_128_CBC_SHA"); parameters.add("sslProtocol", "TLSv1"); sdcClient.start(); System.out .println("Press a key when the SDC agent is started and has established a tunnel..."); System.in.read(); Request request = new Request(Method.GET, "http://restlet.org"); request.setProtocol(Protocol.valueOf("SDC")); request.setProxyChallengeResponse(new ChallengeResponse(ChallengeScheme .valueOf("SDC"), "myUser@example.com", "myPassword")); Response response = sdcClient.handle(request); response.getEntity().write(System.out); } }