当前位置: 首页 > 知识库问答 >
问题:

由于索引处不透明部分中的非法字符,无法用路径加载密钥库类型JKS

端木淇
2023-03-14
    <?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the BIO implementation that requires the JSSE
         style configuration. When using the APR/native implementation, the
         OpenSSL style configuration is required as described in the APR/native
         documentation -->

    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" keystoreFile="C:\disk01\keystores" keystorePass="myPassWord" />

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>

2016年3月23日下午5:05:55 org.apache.coyote.abstractProtocol init严重:未能初始化与ProtocolHandler关联的endpoint[“http-bio-8443”]java.io.ioException:由于在

共有1个答案

司马自明
2023-03-14

OS:Window
Server:Tomcat 9
Java:8u201 64位

<Connector port="8443"
    maxHttpHeaderSize="8192"
    maxThreads="150"
    minSpareThreads="25"
    maxSpareThreads="75"
    enableLookups="false"
    disableUploadTimeout="true"
    acceptCount="100"
    scheme="https"
    secure="true"
    clientAuth="false"
    sslProtocol="TLS"
    SSLEnabled="true"
    URIEncoding="UTF-8" 
    keyAlias="cifin" 
    keystorePass="changeit" 
    keystoreFile=<SOME_SETTING> />

我得到这个错误是由于Tomcat的server.xml连接器中的以下设置-

keystoreFile="file:\\\%JAVA_HOME%\jre\lib\security\cacerts"

那么我改变如下-

keystoreFile="file:\\\C:\apps\Java\8\jdk1.8.0_201\jre\lib\security\cacerts"
keystoreFile="file:///C:/apps/Java/8/jdk1.8.0_201/jre/lib/security/cacerts"
 类似资料:
  • 问题内容: 我在RAD中收到以下错误: 您能否让我知道错误是什么以及如何解决? 问题答案: 索引16处有一个非法字符。我想说它不喜欢路径中的空格。您可以百分比编码特殊字符,例如空格。在这种情况下,将其替换为%20。 我上面链接的问题建议使用URLEncoder:

  • 我知道问题是“My Program.War”中有一个空格,我只是不知道如何摆脱它。最初,我的Java项目名为“my Program”,但由于我一直遇到这个错误,我将其重命名为“My-Program”。这改变了文件夹名称和项目名称,但由于某种原因,当我部署我的Glassfish应用程序时,它尝试使用旧名称。如何更新此信息?

  • 我想在Spring Boot中的安全endpoint上设计https的使用我生成PKCS12格式的证书并将生成的证书放在资源文件夹下当我运行gradle build命令时,我可能会出现以下错误 proerty文件如下所示 主程序 控制器看起来像这样 SSL生成命令是openssl gradle文件如下所示:

  • 我有一个Spring Cloud配置服务器,它使用密钥库解密git服务器中的值。如果我使用文件路径引用密钥库,它会按预期工作并解密{cipher}值。但是,如果我尝试从类路径加载密钥库,它会停止工作,出现以下错误:CipherEnvironmentEncryptor.decrypt-无法解密密钥:用户名(类java.lang.IllegalStateException:无法从存储中加载密钥:类路径

  • 我在WSO2 ESB中使用GET方法定义了如下API资源: 现在,如果我通过标准浏览器(如chrome或firefox)调用API,它可以正常工作,并且我得到的响应代码是ok 200 但是我不能通过Postman调用这个API,它返回NotFound404。如果我将“سلام”替换为像“hello”这样的标准ascii字符串,它工作正常,并返回代码ok 200: 我在postman的Headers

  • 我正在做的:我试图在android中做一个反向地理编码 这一行给出了这个错误:: jsonFunctions.java