简体   繁体   English

"如何在 https 上运行 IntelliJ tomcat 服务器?"

[英]How to run IntelliJ tomcat server on https?

i need to test with Okta SSO which only allows https connection so how can i run IntelliJ tomcat server on https?我需要使用仅允许 https 连接的 Okta SSO 进行测试,那么如何在 https 上运行 IntelliJ tomcat 服务器?

I have configured the below on c drive tomcat server using below instructions but don't know how to setup ssl on intellij tomcat server?我已经使用以下说明在 C 盘 tomcat 服务器上配置了以下内容,但不知道如何在 intellij tomcat 服务器上设置 ssl?

Done -完毕 -

Prerequisite :先决条件:


1)JDK installed + JAVA_HOME environment variable setup 1)JDK安装+JAVA_HOME环境变量设置

  1. Tomcat 8.0 archieve file Tomcat 8.0 归档文件

Now open cmd : run this command:现在打开 cmd :运行以下命令:

cd %JAVA_HOME%/bin

Step 1: Generating keystore file : .keystore第 1 步:生成密钥库文件:.keystore


keytool -genkey -alias tomcat -keyalg RSA keytool -genkey -alias tomcat -keyalg RSA

and save entered password : password1并保存输入的密码:password1


Step 2: Now we will configure tomcat for using keystore file and -SSL config第 2 步:现在我们将配置 tomcat 以使用密钥库文件和 -SSL 配置


-->now open server.xml file and replace following : --> 现在打开 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" />

Step 3: Now we will configure our web app to run on https.第 3 步:现在我们将配置我们的 Web 应用程序以在 https 上运行。


-->open web.xml of web application. --> 打开 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>

Step 4: Test Run第 4 步:试运行

Make sure the keystoreFile="/Users/.keystore" is specified correctly, see Tomcat Troubleshooting section:确保正确指定了keystoreFile="/Users/.keystore" ,请参阅 Tomcat 故障排除部分:

By default, Tomcat expects the keystore file to be named .keystore in the user home directory under which Tomcat is running (which may or may not be the same as yours :-).默认情况下,Tomcat 期望密钥库文件在 Tomcat 运行的用户主目录中命名为.keystore (可能与您的主目录相同,也可能不同:-)。 If the keystore file is anywhere else, you will need to add a keystoreFile attribute to the <Connector> element in the Tomcat configuration file.如果密钥库文件位于其他任何位置,则需要将keystoreFile属性添加到 Tomcat 配置文件中的<Connector>元素。

我遇到了同样的问题,通过删除 . 解决了,你不在 Linux 中:keystoreFile="C:\\Users\\Selva\\keystore"

"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM