diff --git a/docs/manual/src/asciidoc/index.adoc b/docs/manual/src/asciidoc/index.adoc index 445e1d71d1..c8ed99dbff 100644 --- a/docs/manual/src/asciidoc/index.adoc +++ b/docs/manual/src/asciidoc/index.adoc @@ -5525,7 +5525,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) // Make a remote call using the proxy ticket final String serviceUrl = targetUrl+"?ticket="+URLEncoder.encode(proxyTicket, "UTF-8"); - String proxyResponse = CommonUtils.getResponseFromServer(new URL(serviceUrl), connectionFactory, "UTF-8"); + String proxyResponse = CommonUtils.getResponseFromServer(serviceUrl, "UTF-8"); ... } ---- diff --git a/samples/cas/sample-xml/src/integration-test/groovy/org/springframework/security/samples/cas/CasSampleProxyTests.groovy b/samples/cas/sample-xml/src/integration-test/groovy/org/springframework/security/samples/cas/CasSampleProxyTests.groovy index bbd24c67da..059e0f16e7 100644 --- a/samples/cas/sample-xml/src/integration-test/groovy/org/springframework/security/samples/cas/CasSampleProxyTests.groovy +++ b/samples/cas/sample-xml/src/integration-test/groovy/org/springframework/security/samples/cas/CasSampleProxyTests.groovy @@ -19,7 +19,6 @@ import org.apache.commons.httpclient.HttpClient import org.apache.commons.httpclient.methods.GetMethod import org.jasig.cas.client.jaas.CasLoginModule; import org.jasig.cas.client.proxy.Cas20ProxyRetriever -import org.jasig.cas.client.ssl.HttpsURLConnectionFactory import org.springframework.security.samples.cas.pages.* import spock.lang.* @@ -37,7 +36,7 @@ class CasSampleProxyTests extends AbstractCasTests { HttpClient client = new HttpClient() @Shared String casServerUrl = LoginPage.url.replaceFirst('/login','') @Shared JettyCasService service = new JettyCasService().init(casServerUrl) - @Shared Cas20ProxyRetriever retriever = new Cas20ProxyRetriever(casServerUrl,'UTF-8', new HttpsURLConnectionFactory()) + @Shared Cas20ProxyRetriever retriever = new Cas20ProxyRetriever(casServerUrl,'UTF-8') @Shared String pt def cleanupSpec() { diff --git a/samples/cas/sample-xml/src/main/java/org/springframework/security/samples/cas/web/ProxyTicketSampleServlet.java b/samples/cas/sample-xml/src/main/java/org/springframework/security/samples/cas/web/ProxyTicketSampleServlet.java index 10ad643566..f5c7654143 100644 --- a/samples/cas/sample-xml/src/main/java/org/springframework/security/samples/cas/web/ProxyTicketSampleServlet.java +++ b/samples/cas/sample-xml/src/main/java/org/springframework/security/samples/cas/web/ProxyTicketSampleServlet.java @@ -17,7 +17,6 @@ package org.springframework.security.samples.cas.web; import java.io.IOException; import java.io.PrintWriter; -import java.net.URL; import java.net.URLEncoder; import javax.servlet.ServletException; @@ -25,8 +24,6 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.jasig.cas.client.ssl.HttpURLConnectionFactory; -import org.jasig.cas.client.ssl.HttpsURLConnectionFactory; import org.jasig.cas.client.util.CommonUtils; import org.springframework.security.cas.authentication.CasAuthenticationToken; @@ -45,8 +42,6 @@ public final class ProxyTicketSampleServlet extends HttpServlet { * This is the URL that will be called and authenticate a proxy ticket. */ private String targetUrl; - - private HttpURLConnectionFactory connectionFactory = new HttpsURLConnectionFactory(); @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) @@ -58,7 +53,7 @@ public final class ProxyTicketSampleServlet extends HttpServlet { // Make a remote call to ourself. This is a bit silly, but it works well to demonstrate how to use proxy tickets. final String serviceUrl = targetUrl+"?ticket="+URLEncoder.encode(proxyTicket, "UTF-8"); - String proxyResponse = CommonUtils.getResponseFromServer(new URL(serviceUrl), connectionFactory, "UTF-8"); + String proxyResponse = CommonUtils.getResponseFromServer(serviceUrl, "UTF-8"); // modify the response and write it out to inform the user that it was obtained using a proxy ticket. proxyResponse = proxyResponse.replaceFirst("Secure Page", "Secure Page using a Proxy Ticket");