我需要使用仅允许 https 连接的 Okta SSO 进行测试,那么如何在 https 上运行 IntelliJ tomcat 服务器?
我已经使用以下说明在 C 盘 tomcat 服务器上配置了以下内容,但不知道如何在 intellij tomcat 服务器上设置 ssl?
完毕 -
先决条件:
1)JDK安装+JAVA_HOME环境变量设置
- Tomcat 8.0 归档文件
现在打开 cmd :运行以下命令:
cd %JAVA_HOME%/bin
第 1 步:生成密钥库文件:.keystore
keytool -genkey -alias tomcat -keyalg RSA
并保存输入的密码:password1
第 2 步:现在我们将配置 tomcat 以使用密钥库文件和 -SSL 配置
--> 现在打开 server.xml 文件并替换以下内容:
<Connector SSLEnabled="true" acceptCount="100" clientAuth="false"
disableUploadTimeout="true" enableLookups="false" maxThreads="25"
port="8443" keystoreFile="C:\Users\Selva\.keystore"
keystorePass="password"
protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https"
secure="true" sslProtocol="TLS" />
第 3 步:现在我们将配置我们的 Web 应用程序以在 https 上运行。
--> 打开 web 应用程序的 web.xml。
<security-constraint>
<web-resource-collection>
<web-resource-name>securedapp</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
第 4 步:试运行