如何使java-tomee应用程序使用HTTPS?
问题描述:
我一直在使用Java和apache tomee开发一个Web应用程序,但是我想将其设置为https,以便可以将其提供给一些客户端,但是我不知道如何创建证书并使该应用程序通过安全通道.
I have been developing a web application with java and apache tomee, but I want to make it https so I can offer it to a few clients but I have no idea on how to create the certificates and make the application go through a secure channel.
我尝试了一些教程,但似乎没有任何运气.
I have tried a few tutorials bit I don't seem to have any luck.
有人知道怎么做吗?
非常感谢您!
答
编辑server.xml
:
!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<Connector
protocol="org.apache.coyote.http11.Http11NioProtocol"
port="443"
maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreType="Windows-MY"
keyAlias="MyKeyAliasInWindowsKeystore"
clientAuth="false"
sslProtocol="TLS"/>
Tomee本质上是带有一堆J2EE库的tomcat,因此SSL功能实际上是由Tomcat执行的.
Tomee is basically a tomcat with a bunch of J2EE libraries, so the SSL function is actually performed by Tomcat.