作者vinchen0102 (Wen)
看板Web_Design
标题[问题] ssl 无法连线
时间Sun Mar 9 18:41:07 2008
最近在看有关於java servlet 的书,看有关於security 的部分。
每次看到网页当入会员的地方,网址都是https开头,让我对SSL 很有兴趣,所以今天自己
试了一下。
我用的是 Apache Tomcat
在 \ROOT\WEB-INF\web.xml 里面 加入了下面部分
<security-constraint>
<web-resource-collection>
<web-resource-name>
SecretProtection
</web-resource-name>
<url-pattern>
/login
</url-pattern>
<http-method>
GET
</http-method>
<http-method>
POST
</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>
manager
</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>
CONFIDENTIAL
</transport-guarantee>
</user-data-constraint>
</security-constraint>
基本上,是跟着书上写的做。
书是学校图书馆借来的:Java servlet programming O'REILLY 的书
当我在网址打入
http://localhost:8080/login
後,网址会自动转换成为
https://localhost:8443/login
但是,竟然出现了
Problem loading page
Unable to connect
Firefox can't establish a connection to the server at localhost:8443.
* The site could be temporarily unavailable or too busy. Try again in a
few
moments.
* If you are unable to load any pages, check your computer's network
connection.
* If your computer or network is protected by a firewall or proxy, make
sure
that Firefox is permitted to access the Web.
也就是说,根本连线不到,真的搞不清楚是什麽原因造成的。
把 web.xml 那段拿掉,那一页又恢复正成了,只是没有SSL。
但是我真的很想要用SSL...
我的问题是出在哪里呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 219.90.187.87
1F:→ mc18:我是用glassfish, web.xml不用改, 直接改用ssl port就可以 03/10 02:05
2F:→ vinchen0102:意思是说 不要用tomcat 了吗? 03/10 07:57
3F:推 mc18:也不是XD我只是举这个例子,因为我本身颇讨厌汤姆猫的XD 03/10 16:16
4F:→ mc18:没啥特别原因XD不过由此可推论,汤母猫应该也是server设定问题 03/10 16:16