huobao89 2008-11-19 10:58
浏览 301
已采纳

tomcat6和ssl配置

我参考http://www.iteye.com/topic/120780
配置了 tomcat6 ssl
但是http://ip:8443 就是没有显示

我root.p12 server.p12 client.p12 做出来了。
证明书的导入也正常

tomcat的配置,和他的一样

但是http://ip:8443 网页没有显示
myeclipse 没有任何错误的提示
卧室在windows下

还有,之前我整合apache tomcat
但是这次我没有启动apache
应该和apache没有关系把。

帮帮忙
谢谢了
[b]问题补充:[/b]
我参考http://www.iteye.com/topic/120780
配置了 tomcat6 ssl
但是http://ip:8443 就是没有显示

我root.p12 server.p12 client.p12 做出来了。
证明书的导入也正常

tomcat的配置,和他的一样

但是http://ip:8443 网页没有显示
myeclipse 没有任何错误的提示
卧室在windows下

还有,之前我整合apache tomcat
但是这次我没有启动apache
应该和apache没有关系把。

帮帮忙
谢谢了

谢谢bohemia 地回答

我试了 https://ip:8443
还是不好用。myeclipse 没有任何错误的提示

[b]问题补充:[/b]
谢谢bohemia 回答
启动tomcat的时候有问题。
我在配置 tomcat 6 的时候 ,在server.xml文件里
这个部分原先就是注释掉了
<!--
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->

当我把注释去掉,没有加 keystorefile, truststorefile的设置后,
启动 tomcat 有个错误
严重的Catalina.start:
LifecycleException: service.getName(): "Catalina";
java.io.FileNotFoundException: C:\Documents and Settings\xxxxxx.keystore (指定文件找不到)

由于我还没有设置keystorefile, truststorefile
所以,这个错误我觉得是其他错误。
还有,我没有设置什么keystore呀 。我配置的是 .p12
我把我的 tomcat的配置发一下。

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="true" sslProtocol="TLS"

           maxhttpheadersize="8192" minsparethreads="25" maxsparethreads="75"
           enablelookups="false" disableuoloadtimeout="true" acceptcount="100"
           keystorefile="c:/ca/server/server.p12" keystoretype="PKCS12" keystorepass="dalian"
           truststorefile="c:/ca/root/root.jks" truststoretype="JKS" truststorepass="dalian"/>

现在tomcat 启动 ,还是有那个错误
我在网上简单的查了一下。
说的密码不正确导致这个错误。
我所有的密码,就那么一个呀
不太清楚

麻烦你了
[b]问题补充:[/b]
谢谢你bohemia 那么快回答我的问题

我刚才研究了你给我的那两个网页。
那个2个网页跟我配置参考的网页不同的地方是keystoreFile
你告诉我的网页的方法是
keystoreFile="xxxxxxxxxxxxx/server.keystore"
用的是 .keystore 格式
而我参考的网页的方法是
keystorefile="d:/path/bin/x509/server.p12"

keystoretype="PKCS12" keystorepass="123456"
用的是 .p12 格式
.keystore 格式和 .p12 格式应该都可以吧

我不明白的是,
我明明 用 p12格式配置,
如果出错误的话
就应该是 xxxx.p12 找不到。

真是不好意思

[b]问题补充:[/b]
还有
tomcat的错误提示是
C:/Documents and Settings/用户名/.keystore" 指定文件找不到
而我在server.xml设定是
keystorefile="c:/ca/server/server.p12" keystoretype="PKCS12" keystorepass="dalian"

这是怎么搞得。
就是这个地方不是很明白

[b]问题补充:[/b]
谢谢zhjb2000 的回答

你给我的网页我看了
我对密码的理解是
密码可以随便设,但是keyPass,storepass 要一样
我参考的网页是 http://www.albertsong.com/read-99.html

还有 我用你说的密码 changeit 试了
还是那原来的错误

郁闷

不过还是很感谢你
[b]问题补充:[/b]
我这没T6的环境. 没办法帮你看了. 看看T6的 SSL HOWTO 文档吧. 也许有帮助;
bohemia (高级程序员) 2008-11-19 采纳为答案

还是十分感谢 bohemia
虽然没有解决问题
但是,给我很多的提示
谢谢你。
[b]问题补充:[/b]
谢谢 castbsd 的回答

root.jks 中 jks 是 java key store 的缩写吧

配置中 keystore应=root.jks

但是你说的
把 truststorefile 和 keystore中的jks换下看
我有点不明白???
怎么换牙?????
[b]问题补充:[/b]
还有我在写
C = CN
ST = Beijing
L = Xichengqu
O = www.albertsong.com
OU = ca.albertsong.com
CN = Albert Song
emailAddress = test@test.com

写这些东西是胡乱写的。
是不是和这个有影响呀?????
[b]问题补充:[/b]
谢谢castbsd的回答
我试了你说的方法,我兑换了
再我机器上还是没有反应。
郁闷。
我看了tomcat6的文档
我的错误提示是
C:/Documents and Settings/用户名/.keystore" 指定文件找不到
文档中关于这个错误有帮助文档
When Tomcat starts up, I get an exception like "java.io.FileNotFoundException: {some-directory}/{some-file} not found".
A likely explanation is that Tomcat cannot find the keystore file where it is looking. By default, Tomcat expects the keystore file to be named .keystore in the user home directory under which Tomcat is running (which may or may not be the same as yours :-). If the keystore file is anywhere else, you will need to add a keystoreFile attribute to the element in the Tomcat configuration file.

于是,我在server.xml配置中,加了 element
还是不好用。我加的 配置方法是参考
http://makubex.vicp.cc/bbs/thread-14796-1-1.html

郁闷

  • 写回答

8条回答 默认 最新

  • weixin_42298595 2008-11-20 14:10
    关注

    我的错误提示是
    C:/Documents and Settings/用户名/.keystore" 指定文件找不到

    哇。
    你看看是不是把keystoreFile 拼写错了。也很可能是大小写没有写对!!!
    = _=
    配置文件中没有给keystoreFile指定位置时就会在默认的用户名目录下找.keystore文件

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(7条)

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘