【SSO-CAS】将CAS https认证的方式改为http

简介: 国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私募机构九鼎控股打造,九鼎投资是在全国股份转让系统挂牌的公众公司,股票代码为430719,为“中国PE第一股”,市值超1000亿元。
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址: http://jdb.jiudingcapital.com/phone.html
内部邀请码: C8E245J (不写邀请码,没有现金送)
国内私募机构九鼎控股打造,九鼎投资是在全国股份转让系统挂牌的公众公司,股票代码为430719,为“中国PE第一股”,市值超1000亿元。 

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

 

原文地址:http://blog.csdn.net/designlife/article/details/2956814

最近,在做CAS单点登陆的一个模块,由于公司的产品太多,各个系统都要部署,在开发中Https的证书的部署比较麻烦,所以,打算把CAS的Https去掉。具体的修改如下 

1.修改cas-servlet.xml 

Java代码  复制代码
  1. <bean id="warnCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"  
  2.         p:cookieSecure="true"  
  3.         p:cookieMaxAge="-1"  
  4.         p:cookieName="CASPRIVACY"  
  5.         p:cookiePath="/cas" />   
  6.        
  7.     <bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"  
  8.         p:cookieSecure="true "  
  9.         p:cookieMaxAge="-1"  
  10.         p:cookieName="CASTGC"  
  11.         p:cookiePath="/cas" />  
[java]  view plain copy
  1. <bean id="warnCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"  
  2.         p:cookieSecure="true"  
  3.         p:cookieMaxAge="-1"  
  4.         p:cookieName="CASPRIVACY"  
  5.         p:cookiePath="/cas" />  
  6.       
  7.     <bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"  
  8.         p:cookieSecure="true "  
  9.         p:cookieMaxAge="-1"  
  10.         p:cookieName="CASTGC"  
  11.         p:cookiePath="/cas" />  


把上面连个bean中的p:cookieSecure="true "修改为p:cookieSecure="false" 
2.修改deployerConfigContext.xml 

Java代码  复制代码
  1. <bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"  
  2.                     p:httpClient-ref="httpClient" />  
[java]  view plain copy
  1. <bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"  
  2.                     p:httpClient-ref="httpClient" />  



添加p:requireSecure="false" 

3.修改casclient的客户端 

修改客户端的https验证 
(1).edu.yale.its.tp.cas.client.filter.edu.yale.its.tp.cas.client.filter 

Java代码  复制代码
  1. if (! casValidate.startsWith("https://")){   
  2.             throw new ServletException("validateUrl must start with https://, its current value is [" + casValidate + "]");   
  3.         }   
  4. if (casServiceUrl != null){   
  5.             if (! (casServiceUrl.startsWith("https://")|| (casServiceUrl.startsWith("http://") ))){   
  6.                 throw new ServletException("service URL must start with http:// or https://; its current value is [" + casServiceUrl + "]");   
  7.             }   
  8.         }  
[java]  view plain copy
  1. if (! casValidate.startsWith("https://")){  
  2.             throw new ServletException("validateUrl must start with https://, its current value is [" + casValidate + "]");  
  3.         }  
  4. if (casServiceUrl != null){  
  5.             if (! (casServiceUrl.startsWith("https://")|| (casServiceUrl.startsWith("http://") ))){  
  6.                 throw new ServletException("service URL must start with http:// or https://; its current value is [" + casServiceUrl + "]");  
  7.             }  
  8.         }  


把这两段内容注释掉 

(2).修改edu.yale.its.tp.cas.util.SecureURL 

Java代码  复制代码
  1. if (!u.getProtocol().equals("https")){   
  2.                 // IOException may not be the best exception we could throw here   
  3.                 // since the problem is with the URL argument we were passed, not   
  4.                 // IO. -awp9   
  5.                 log.error("retrieve(" + url + ") on an illegal URL since protocol was not https.");   
  6.                             throw new IOException("only 'https' URLs are valid for this method");   
  7.             }  
[java]  view plain copy
  1. if (!u.getProtocol().equals("https")){  
  2.                 // IOException may not be the best exception we could throw here  
  3.                 // since the problem is with the URL argument we were passed, not  
  4.                 // IO. -awp9  
  5.                 log.error("retrieve(" + url + ") on an illegal URL since protocol was not https.");  
  6.                             throw new IOException("only 'https' URLs are valid for this method");  
  7.             }  



把这段内容注释掉

目录
相关文章
|
4月前
|
XML JSON API
识别这些API接口定义(http,https,api,RPC,webservice,Restful api ,OpenAPI)
本内容介绍了API相关的术语分类,包括传输协议(HTTP/HTTPS)、接口风格(RESTful、WebService、RPC)及开放程度(API、OpenAPI),帮助理解各类API的特点与应用场景。
|
4月前
|
Android开发 Kotlin
|
6月前
|
安全 网络安全 数据安全/隐私保护
网页安全演进:HTTP、HTTPS与HSTS
这整个进程实质上是网页安全由“裸奔”到“穿衣”再到“绑带”的演变史。它保障了数据的机密性和完整性,降低了中间人攻击的风险,最终实现了更自由、更安全的网络环境。但别忘了,技术永远在发展,网络安全的赛跑也永无终点。*ENDPOINT*
417 11
|
7月前
|
安全 网络协议 Linux
Linux网络应用层协议展示:HTTP与HTTPS
此外,必须注意,从HTTP迁移到HTTPS是一项重要且必要的任务,因为这不仅关乎用户信息的安全,也有利于你的网站评级和粉丝的信心。在网络世界中,信息的安全就是一切,选择HTTPS,让您的网站更加安全,使您的用户满意,也使您感到满意。
216 18
|
7月前
|
JSON 安全 网络协议
HTTP/HTTPS协议(请求响应模型、状态码)
本文简要介绍了HTTP与HTTPS协议的基础知识。HTTP是一种无状态的超文本传输协议,基于TCP/IP,常用80端口,通过请求-响应模型实现客户端与服务器间的通信;HTTPS为HTTP的安全版本,基于SSL/TLS加密技术,使用443端口,确保数据传输的安全性。文中还详细描述了HTTP请求方法(如GET、POST)、请求与响应头字段、状态码分类及意义,并对比了两者在请求-响应模型中的安全性差异。
721 20
|
7月前
|
安全 网络协议 算法
HTTP/HTTPS与SOCKS5协议在隧道代理中的兼容性设计解析
本文系统探讨了构建企业级双协议隧道代理系统的挑战与实现。首先对比HTTP/HTTPS和SOCKS5协议特性,分析其在工作模型、连接管理和加密方式上的差异。接着提出兼容性架构设计,包括双协议接入层与统一隧道内核,通过协议识别模块和分层设计实现高效转换。关键技术部分深入解析协议转换引擎、连接管理策略及加密传输方案,并从性能优化、安全增强到典型应用场景全面展开。最后指出未来发展趋势将更高效、安全与智能。
272 1
|
8月前
|
安全 网络安全 数据安全/隐私保护
HTTP 与 HTTPS 协议及 SSL 证书解析-http和https到底有什么区别?-优雅草卓伊凡
HTTP 与 HTTPS 协议及 SSL 证书解析-http和https到底有什么区别?-优雅草卓伊凡
452 3
|
10月前
|
网络协议 安全 网络安全
HTTP与HTTPS协议入门
HTTP协议是互联网的基石,HTTPS则是其安全版本。HTTP基于TCP/IP协议,属于应用层协议,不涉及数据包传输细节,主要规定客户端与服务器的通信格式,默认端口为80。
415 25
HTTP与HTTPS协议入门
|
10月前
|
缓存 安全 网络安全
代理协议解析:如何根据需求选择HTTP、HTTPS或SOCKS5?
本文详细介绍了HTTP、HTTPS和SOCKS5三种代理协议的特点、优缺点以及适用场景。通过对比和分析,可以根据具体需求选择最合适的代理协议。希望本文能帮助您更好地理解和应用代理协议,提高网络应用的安全性和性能。
670 17