【问题标题】:Tomcat warnings about SSL, and browser can't find the site关于 SSL 的 Tomcat 警告,并且浏览器找不到该站点
【发布时间】:2017-04-23 00:54:56
【问题描述】:

我的公司有一个网络应用程序;我们使用 NetBeans 在 Win7 上开发,项目在 tomcat 上运行,无论是生产还是开发。

我正在尝试确定迁移到 Eclipse 需要什么。当我最终在 eclipse 中运行(或者至少看起来我有)时,当我告诉 eclipse 运行应用程序时,我会在 eclipse 控制台顶部收到以下消息:

Dec 07, 2016 4:46:30 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'SSLCertificateFile' to 'C:\Users\rcook\eclipse\workspaceEclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\ssl_crt\mycert\server.crt' did not find a matching property.
Dec 07, 2016 4:46:30 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'SSLCertificateKeyFile' to 'C:\Users\rcook\eclipse\workspaceEclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\ssl_crt\mycert\server.key' did not find a matching property.
Dec 07, 2016 4:46:30 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'SSLCipherSuite' to 'RC4-SHA:HIGH:!ADH:!SSLv2:@STRENGTH' did not find a matching property.
Dec 07, 2016 4:46:30 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'SSLPassword' to 'webapps.accesspointinc.com' did not find a matching property.
Dec 07, 2016 4:46:30 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'SSLProtocol' to 'all' did not find a matching property.
Dec 07, 2016 4:46:30 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:salespoint-war' did not find a matching property.
Dec 07, 2016 4:46:30 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_07\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk1.7.0_07\jre\bin;C:/Program Files/Java/jre1.8.0_91/bin/server;C:/Program Files/Java/jre1.8.0_91/bin;C:/Program Files/Java/jre1.8.0_91/lib/amd64;C:\ProgramData\Oracle\Java\javapath;c:\local;c:\devTools\apache-maven\bin;C:\Perl64\site\bin;C:\Perl64\bin;c:\Program Files\Java\jdk1.7.0_07\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\WinMerge;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;c:\Program Files\Apache\apache-cxf-3.1.6\bin;C:\Windows\system32;;.
Dec 07, 2016 4:46:30 PM org.apache.coyote.AbstractProtocol init

http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#SSL_Support 看来,事实上,我们确实正确拼写了属性名称,并且当我们从 NetBeans 而不是从 eclipse 运行项目时,这些相同的设置工作。

日志文件继续,指示仍在执行的各种事情;但是,当服务器初始化全部完成后,该站点将不会响应浏览器。 eclipse内置浏览器提示“无法显示此页面”并提示我“开启TLS 1.0-、1.1和1.2”;假设他们的意思是在 IE 中打开它们,那已经完成了。 Chrome 显示“此站点无法提供安全连接”和“本地主机使用不受支持的协议”。

谁能告诉我这里出了什么问题?

【问题讨论】:

  • 您的配置似乎适用于使用 OpenSSL 的 Tomcat Native(又名 Http11AprProtocol)——您有单独的证书和密钥文件,以及 OpenSSL 格式的密码列表(并且已经过时了几年启动)——但最后一个警告说 Eclipse 中的 Tomcat 没有找到本机库——如果找不到它,我也不会感到惊讶,因为支持特定于平台的代码与 Java 相比很麻烦.除非您需要开发/测试/调试 TLS 详细信息,否则最好将您的证书和密钥转换为 Java 格式(JKS 或现在的 PKCS12);已经有很多问题了。

标签: java eclipse tomcat ssl


【解决方案1】:

这个post 表明它失败了,因为 Eclipse 和 NetBeans 以不同的方式设置 SSL 证书。 我建议搜索如何在 Eclipse 中设置 SSL 证书。试试this one

【讨论】:

  • 我使用了您链接页面上建议的 keytool 导入,据我所知,并得到相同的结果。服务器启动的控制台仍然有消息说“没有找到匹配的属性”,当我加载任何页面“localhost”或“localhost/appName”时,它说它无法提供安全连接。当消息和配置似乎都与tomcat有关时,我不明白为什么eclipse和netbeans之间有区别,而且我不明白“找不到匹配的属性”与安全问题有何关系。
  • server.xml 中有一个连接器,用于我添加到 Eclipse 工作区的 tomcat 7 服务器,它指定 SSLCertificateFile 和 SSLCertificateKeyFile 以及其他内容;这用于 Netbeans 案例并且有效。当eclipse运行这个服务器时,有什么方法可以让它工作吗?这就是我所追求的。
猜你喜欢
  • 1970-01-01
  • 2015-12-21
  • 2018-07-14
  • 2013-07-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-06-19
  • 1970-01-01
相关资源
最近更新 更多