`
programmer
  • 浏览: 75675 次
  • 性别: Icon_minigender_1
文章分类
社区版块
存档分类
最新评论

这样使用ssl对吗?(websphere)

阅读更多
环境:wsad5.12自带的websphere5.1测试环境
因为缺省websphere的测试环境带有9080和9443端口,其中9080是用于非加密的数据传输,9443用于ssl加密数据传输。
需求:
1.要求登陆页面提交的数据必须通过ssl加密提交到服务器。
2.登录完之后,其他的业务功能都不能通过ssl加密进行传输数据。
我的解决方案:
1.系统将一个property文件,用于记录websphere的两个端口9080和9443
2.如果客户录入的不是https,那么系统自动转到htts的页面,并且从property文件读出端口9443。让其重新加载页面。(判断是通过javascript文件来)
3.等页面提交后然后需要加载新的页面的时候又重新定位到安http来加载页面,当然非ssl加密端口也是从property文件读出。
经过测试,这样是能解决我的需求的,但总是绝的很变扭,首先得建一个property文件来记录两个端口号。从ssl转到非ssl功能还得通过程序来处理。觉得很不爽。
大家看我这样用对吗?有没有好的方法。
分享到:
评论
2 楼 programmer 2007-01-13  
codeutil 写道
不知道有 request.getScheme() 吗???
使用过滤器或者:
web.xml里配置:
<security-constraint>
  <web-resource-collection>
   <web-resource-name>must https</web-resource-name>
   <url-pattern>/logon.do</url-pattern>
  </web-resource-collection>
  <user-data-constraint>
   <transport-guarantee>CONFIDENTIAL</transport-guarantee>
  </user-data-constraint>
</security-constraint>
1.我知道有request.getSchema() 返回的是http或者https。
2.请问使用过滤器怎么做。
3.你说的 <transport-guarantee>CONFIDENTIAL</transport-guarantee> 我试过是不可行的,虽然通过这样的配置,如果客户端请求的不是https而是http,那么系统将自动转向用https连接(正确的使用上9443端口),但有一个问题此时还没有真正进入index.jsp页面就会弹出一个窗口要求输入 用户名,密码(websphere 配置的时候“启用安全性的时候”录入用户名,密码),如果通过验证,然后才进入index.jsp页面,这样的话在实践应用明显是有问题的。原因有
A.无怨无故要求客户端多输一次验证。
B.在websphere启用安全验证配置是部署项目的人设的。客户端根本不知道。
4.我说的方法肯定能解决问题(达到ssl加密传输和非加密传输透明交替时候)客户端根本觉察不到,客户端就像完全是非ssl传输一样使用,不用任何的多余动作。不足的地方我也说,就是感觉变扭。
1 楼 codeutil 2007-01-12  
不知道有 request.getScheme() 吗???
使用过滤器或者:
web.xml里配置:
<security-constraint>
  <web-resource-collection>
   <web-resource-name>must https</web-resource-name>
   <url-pattern>/logon.do</url-pattern>
  </web-resource-collection>
  <user-data-constraint>
   <transport-guarantee>CONFIDENTIAL</transport-guarantee>
  </user-data-constraint>
</security-constraint>

相关推荐

Global site tag (gtag.js) - Google Analytics