使用cloudflare提供的SSL配置tomee的正确方法一直存在问题。第一次这样做,情况如下:
1)首先创建密钥存储库文件:
keytool -keysize 2048 -genkey -alias tomee -keyalg RSA -keystore tomee.keystore2)然后导入生成的密钥存储库:
keytool -importkeystore -srckeystore tomee.keystore -destkeystore tomee.keystore -deststoretype pkcs123)导入后,我创建用于发出证书请求的CSR文件:
keytool -certreq -keyalg RSA -alias tomee -file FQDN.csr -keystore tomee.keystore4)然后进入cloudflare > ssl/tls >源程序服务器>创建证书>选择“我有自己的私钥和csr”>然后将FDQN.csr内容粘贴到文本区域>单击next >最后,我收到FQDN.pem保存在服务器上的内容。
5)将FQDN.pem作为可信证书导入密钥存储库:
keytool -import -alias tomee -keystore tomee.keystore -trustcacerts -file FQDN.pem6)将tomee.keystore文件复制到tomee中
7)最后,我将server.xml配置为tomee,如下所示:
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true"
compression="on" scheme="https" secure="true" keystoreFile="conf/tomee.keystore"
keystorePass="myPasswordHere"
SSLVerifyClient="none" SSLProtocol="TLSv1.2"
/>8) 这里遇到了问题:重新启动tomcat并通过端口8443发出请求。它可以工作,但证书显示为无效。查看证书,我得到以下信息:“此CA根证书不受信任,因为它不在受信任的根证书颁发机构存储区中。”
正如我所看到的,通过文档这里-添加Cloudflare原产地CA根证书,我可能需要在提供的文件中添加额外的配置。我的理解是正确的还是我遗漏了什么?如果是的话-那些吐露会是什么样子?我应该做一些类似于server.xml文件中演示的格式的事情,比如:(或者这是一件完全不同的事情?)
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150" SSLEnabled="true" >
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" xpoweredBy="false" server="Apache TomEE" />
<SSLHostConfig>
<Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
certificateFile="conf/localhost-rsa-cert.pem"
certificateChainFile="conf/localhost-rsa-chain.pem"
type="RSA" />
</SSLHostConfig>
</Connector>有趣的是,网上并没有那么多的信息,我一直在努力理解这个问题已经好几天了。任何关于这方面的灯光都会有帮助。
向发布类似主题这里的人致敬
发布于 2020-06-08 10:43:16
设法解决了。对任何感兴趣的人来说,有两个问题:
1)在为tomcat/tomee key服务器执行步骤5之前,您需要添加一个受信任的根证书,并使用这里(在Cloudflare SSL/TLS应用程序中配置SSL/TLS模式)提供的cloudflare密钥。
keytool -import -alias root -keystore tomee.keystore -trustcacerts -file origin_ca_rsa_root.pem然后将您的别名rsa添加到keystore中,如5所示。
2)另一个问题是cloudflare DNS设置上被忽略的CN配置,因此请检查您的信任。
希望这对某人有帮助:)
https://stackoverflow.com/questions/62248306
复制相似问题