我正在尝试在 CentOS 上为 HiveMQ 3.4.2 的 Web UI 启用 ssl 连接。我已经像这样更改了 config.xml 文件
<?xml version="1.0"?>
<hivemq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../hivemq-config.xsd">
...
<web-ui>
<enabled>true</enabled>
<listeners>
<https>
<port>8080</port>
<bind-address>0.0.0.0</bind-address>
<tls>
<keystore>
<path>/home/hivemq/myjks.jks</path>
<password>changeme</password>
<private-key-password>changeme</private-key-password>
</keystore>
</tls>
</https>
</listeners>
...
</web-ui>
...
</hivemq>
我正在使用这一行创建自签名证书:
keytool -genkey -keyalg RSA -alias hivemq -keystore hivemq.jks -storepass changeme -validity 360 -keysize 2048
如果我尝试启动 HiveMQ,我会收到一条错误消息:
2019-03-11 19:19:05,671 WARN - 失败 SslContextFactory@628bd77e(,): java.io.FileNotFoundException: /home (是一个目录) java.io.FileNotFoundException: /home (是一个目录) 在 java.io .FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) at org.eclipse.jetty.util.resource.FileResource。 org.eclipse.jetty.util.ssl.SslContextFactory.loadKeyStore(Unknown Source) 的 org.eclipse.jetty.util.security.CertificateUtils.getKeyStore(Unknown Source) 的 getInputStream(Unknown Source)。 ssl.SslContextFactory.doStart(Unknown Source) 在 org.eclipse.jetty.util.component.AbstractLifeCycle。在 org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source) 在 org.eclipse.jetty.server 的 org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) 开始(未知来源)。 SslConnectionFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) at org.eclipse.jetty。 util.component.ContainerLifeCycle.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractConnector.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(Unknown Source) at org.eclipse.jetty。 server.ServerConnector.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.server.Server.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at et.aa(Unknown Source) at et.aa(Unknown Source) at com.hivemq.HiveMQServer.b(Unknown Source) at com.hivemq.HiveMQServer.a(Unknown Source) at com.hivemq.HiveMQServer.main(Unknown Source )b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)
2019-03-11 19:19:05,672 WARN - 失败 SslConnectionFactory@2fafa7b5{SSL-HTTP/1.1}:java.io.FileNotFoundException:/home(是一个目录) java.io.FileNotFoundException:/home(是一个目录)在 java.io.FileInputStream.open0(Native Method) 在 java.io.FileInputStream.open(FileInputStream.java:195) 在 java.io.FileInputStream.(FileInputStream.java:138) 在 org.eclipse.jetty.util。 resource.FileResource.getInputStream(Unknown Source) at org.eclipse.jetty.util.security.CertificateUtils.getKeyStore(Unknown Source) at org.eclipse.jetty.util.ssl.SslContextFactory.loadKeyStore(Unknown Source) at org.eclipse。 jetty.util.ssl.SslContextFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle。在 org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source) 在 org.eclipse.jetty.server 的 org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) 开始(未知来源)。 SslConnectionFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) at org.eclipse.jetty。 util.component.ContainerLifeCycle.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractConnector.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(Unknown Source) at org.eclipse.jetty。 server.ServerConnector.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.server.Server.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at et.aa(Unknown Source) at et.aa(Unknown Source) at com.hivemq.HiveMQServer.b(Unknown Source) at com.hivemq.HiveMQServer.a(Unknown Source) at com.hivemq.HiveMQServer.main(Unknown Source )b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)
2019-03-11 19:19:05,672 WARN - 失败的 ServerConnector@181098bf{SSL-HTTP/1.1}{0.0.0.0:8443}:java.io.FileNotFoundException:/home(是一个目录)java.io.FileNotFoundException: /home(是一个目录)在 java.io.FileInputStream.open0(Native Method) 在 java.io.FileInputStream.open(FileInputStream.java:195) 在 java.io.FileInputStream.(FileInputStream.java:138) 在 org .eclipse.jetty.util.resource.FileResource.getInputStream(Unknown Source) at org.eclipse.jetty.util.security.CertificateUtils.getKeyStore(Unknown Source) at org.eclipse.jetty.util.ssl.SslContextFactory.loadKeyStore(Unknown来源)在 org.eclipse.jetty.util.ssl.SslContextFactory.doStart(未知来源)在 org.eclipse.jetty.util.component.AbstractLifeCycle。在 org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source) 在 org.eclipse.jetty.server 的 org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) 开始(未知来源)。 SslConnectionFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) at org.eclipse.jetty。 util.component.ContainerLifeCycle.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractConnector.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(Unknown Source) at org.eclipse.jetty。 server.ServerConnector.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.server.Server.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at et.aa(Unknown Source) at et.aa(Unknown Source) at com.hivemq.HiveMQServer.b(Unknown Source) at com.hivemq.HiveMQServer.a(Unknown Source) at com.hivemq.HiveMQServer.main(Unknown Source )b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)
2019-03-11 19:19:05,673 WARN - FAILED org.eclipse.jetty.server.Server@632b5c79: java.io.FileNotFoundException: /home (是一个目录) java.io.FileNotFoundException: /home (是一个目录) 在 java.io.FileInputStream.open0(Native Method) 在 java.io.FileInputStream.open(FileInputStream.java:195) 在 java.io.FileInputStream.(FileInputStream.java:138) 在 org.eclipse.jetty.util .resource.FileResource.getInputStream(Unknown Source) at org.eclipse.jetty.util.security.CertificateUtils.getKeyStore(Unknown Source) at org.eclipse.jetty.util.ssl.SslContextFactory.loadKeyStore(Unknown Source) at org.eclipse .jetty.util.ssl.SslContextFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle。在 org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source) 在 org.eclipse.jetty.server 的 org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) 开始(未知来源)。 SslConnectionFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) at org.eclipse.jetty。 util.component.ContainerLifeCycle.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractConnector.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(Unknown Source) at org.eclipse.jetty。 server.ServerConnector.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.server.Server.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at et.aa(Unknown Source) at et.aa(Unknown Source) at com.hivemq.HiveMQServer.b(Unknown Source) at com.hivemq.HiveMQServer.a(Unknown Source) at com.hivemq.HiveMQServer.main(Unknown Source )b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)
2019-03-11 19:19:05,673 错误 - 无法启动 Web UI:/home(是一个目录)
我不知道出了什么问题。有人能帮助我吗。