ygh_sino
「已注销」
采纳率50%
2016-03-29 02:59 阅读 1.8k

tomcat https 双向配置走外网访问不了

公司接口要求走https协议,我用jdk自带的生成了服务端和客户端的证书。
图片说明

部署项目的tomcat里配置是:
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="C:/up/server/serverKeystore.jks" keystorePass="tytell"
truststoreFile="C:/up/server/serverTruststore.jks" truststorePass="tytell"/>

调用程序加载是:
FileInputStream keyStoreIn = new FileInputStream(new File("D:\TellingWork\key\clientKeystore.jks"));

FileInputStream trustStoreIn = new FileInputStream(new File("D:\TellingWork\key\clientTruststore.jks"));
try {

keyStore.load(keyStoreIn, "tytell".toCharArray());

trustStore.load(trustStoreIn, "tytell".toCharArray());

调用程序用内网访问https是可以,但外网为啥不行啊???

用外网抛的错:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? 
请教各位啊,有点捉急!!!
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

相关推荐