CAS https方式改简单http方式

一、CAS客户端HTTPSHTTP方式

1.修改所有使用到casclient.jar的项目中该jar包内edu.yale.its.tp.cas.util.SecureURL.class文件(需要进行反编译成java类文件“SecureURL.java),将下边代码中对https访问方式的验证代码注释掉(绿色部分)。

    public static String retrieve(String url) throws IOException {

       if (log.isTraceEnabled())

           log.trace("entering retrieve(" + url + ")");

       BufferedReader r = null;

       String s;

       try {

           URL u = new URL(url);

           /*if (!u.getProtocol().equals("https")) {

              log.error("retrieve(" + url

                     + ") on an illegal URL since protocol was not https.");

              throw new IOException(

                     "only 'https' URLs are valid for this method");

           }*/

           URLConnection uc = u.openConnection();

           uc.setRequestProperty("Connection", "close");

           r = new BufferedReader(new InputStreamReader(uc.getInputStream()));

           StringBuffer buf = new StringBuffer();

           String line;

           while ((line = r.readLine()) != null)

              buf.append(line + "\n");

           s = buf.toString();

       } finally {

           try {

              if (r != null)

                  r.close();

           } catch (IOException ex) {

           }

       }

       return s;

    }

2.修改页面上的https开头的连接,改为http

 修改login.jsp页面内容

 

 

 

修改前:

 

https://passport.com/login

https://passport.com/proxyValidate

修改后:

http://passport.com:8080/login

http://passport.com:8080/proxyValidate

 修改logout.jsp页面内容

修改前:

 var="netid"

scope="session" logoutUrl="https://passport.com/logout"/>

修改后:

 var="netid"

 scope="session" logoutUrl="http://passport.com/logout"/>

你可能感兴趣的:(CAS https方式改简单http方式)