WSO2 EI 6.5.0 中的相互 SSL - FileNotFoundException - 无法从文件路径加载 customSSLProfiles

问题描述 投票:0回答:1

我正在按照此 blog

中提到的确切步骤在 WSo2 EI 中尝试 Mutual SSL

WSO2 EI 充当

client
而 Axis2server 是
backend

  • 创建密钥库,导出证书,将 Axis2 证书导入到 wso2 EI Truststore 中,使用
    Java keytool
  • 成功完成
  • 通过使用 WSO2 EI 的默认密钥库,导出证书并将 EI 证书导入 Axis2 Truststore 也完成了。
  • /etc/hosts
    文件中配置主机名在
    Windows 11
  • 中完成

以下提到的更改(

https transport receiver
)在
<EI_HOME>/samples/axis2Server/repository/conf/axis2.xml

中完成
<transportReceiver name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLListener">
    <parameter name="port" locked="false">9002</parameter>
    <parameter name="non-blocking" locked="false">true</parameter>
    <parameter name="keystore" locked="false">
        <KeyStore>
            <Location>C:/Development_Avecto/mutualssl/axis2.jks</Location>
            <Type>JKS</Type>
            <Password>axispwd</Password>
            <KeyPassword>axispwd</KeyPassword>
        </KeyStore>
    </parameter>
    <parameter name="truststore" locked="false">
        <TrustStore>
            <Location>C:/Development_Avecto/mutualssl/truststore-axis2.jks</Location>
            <Type>JKS</Type>
            <Password>axispwd</Password>
        </TrustStore>
    </parameter>
    <parameter name="SSLVerifyClient">require</parameter>
</transportReceiver>

Axis2 密钥库相关文件的路径:

以下提到的更改(

https transport sender
)在
<EI_HOME>/conf/axis/axis2.xml

中完成
    <transportSender name="https" class="org.apache.synapse.transport.passthru.PassThroughHttpSSLSender">
        <parameter name="non-blocking" locked="false">true</parameter>
        <parameter name="keystore" locked="false">
            <KeyStore>
                <Location>C:/Development_Avecto/mutualssl/wso2ei-6.5.0/repository/resources/security/wso2carbon.jks</Location>
                <Type>JKS</Type>
                <Password>wso2carbon</Password>
                <KeyPassword>wso2carbon</KeyPassword>
            </KeyStore>
        </parameter>
        <parameter name="truststore" locked="false">
            <TrustStore>
                <Location>C:/Development_Avecto/mutualssl/wso2ei-6.5.0/repository/resources/security/client-truststore.jks</Location>
                <Type>JKS</Type>
                <Password>wso2carbon</Password>
            </TrustStore>
        </parameter>
        <parameter name="HostnameVerifier">AllowAll</parameter>
        <parameter name="dynamicSSLProfilesConfig">
 <filePath>C:/Development_Avecto/mutualssl/wso2ei-6.5.0/repository/deployment/server/mutual_ssl_profiles.xml</filePath>
 <fileReadInterval>3600000</fileReadInterval>  
</parameter>
</transportSender>

EI 密钥库相关文件的路径:

multi_ssl_profiles.xml:

    <parameter name="customSSLProfiles">
<profile>
 <servers>axis2.backend.mytest:9002</servers>
 <TrustStore>
 <Location>C:/Development_Avecto/mutualssl/wso2ei-6.5.0/repository/resources/security/client-truststore.jks</Location>
 <Type>JKS</Type>
 <Password>wso2carbon</Password>
 </TrustStore>
 <KeyStore>
 <Location>C:/Development_Avecto/mutualssl/wso2ei-6.5.0/repository/resources/security/wso2carbon.jks</Location>
 <Type>JKS</Type>
 <Password>wso2carbon</Password>
 <KeyPassword>wso2carbon</KeyPassword>
 </KeyStore>
</profile>
</parameter>

multi_ssl_profile.xml 的路径:

  • Axis2server.bat
    开始运行

  • 当启动 EI 服务器时,日志中出现错误。

    [2023-04-02 19:36:08,661] [] ERROR - ClientConnFactoryBuilder FileNotFoundException - Could not load customSSLProfiles from file path: C:/Development_Avecto/mutualssl/wso2ei-6.5.0/repository/deployment/server/mutual_ssl_profiles.xml java.io.FileNotFoundException: C:\Development_Avecto\MUTUAL~1\WSO2EI~2.0\C:\Development_Avecto\mutualssl\wso2ei-6.5.0\repository\deployment\server\mutual_ssl_profiles.xml (The filename, directory name, or volume label syntax is incorrect)

  • 我交叉验证了我系统中所有在服务器配置文件中正确配置的文件路径。

WSO2Carbon.log:

C:\Development_Avecto\mutualssl\wso2ei-6.5.0\bin>integrator.bat
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis21685270121738350762org.wso2.carbon.tenant.usage.agent_4.6.25.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis22365369074604097889org.wso2.carbon.unifiedendpoint.core_4.4.105.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis22484470567311214614org.wso2.carbon.feature.mgt.services_4.4.40.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis22882274326877111289org.wso2.carbon.security.mgt_5.12.387.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis23397466027925648469org.wso2.carbon.humantask.coordination.module_4.4.105.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis23826383857512905892rampart-core_1.6.1.wso2v34.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis23936827796259388916org.wso2.carbon.server.admin_4.4.40.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis2398708244506101054org.wso2.carbon.relay.module_4.6.150.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis24000738076295130724sandesha2.mar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis24595686862628660541org.jaggeryjs.jaggery.core_0.12.9.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis24600551926488880614org.wso2.carbon.tenant.throttling.agent_4.6.25.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis25515341727357854029SimpleStockQuoteService.aar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis27023754503605288373org.wso2.carbon.addressing_4.4.40.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis27148714431294511025org.wso2.carbon.registry.server_4.4.40.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis27314118138075719041CreditRatingService-3.6.0.aar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis28350486285000973665org.wso2.carbon.statistics_4.6.65.jar - The process cannot access the file because it is being used by another process.
axis2-tmp-3089679637551580109.tmp\axis2900163129355678494rampart-trust_1.6.1.wso2v34.jar - The process cannot access the file because it is being used by another process.
JAVA_HOME environment variable is set to C:\Program Files\Java\jdk1.8.0_291
CARBON_HOME environment variable is set to C:\Development_Avecto\MUTUAL~1\WSO2EI~2.0\bin\..
[2023-04-02 19:35:39,642] []  INFO - CarbonCoreActivator Starting WSO2 Carbon...
[2023-04-02 19:35:39,657] []  INFO - CarbonCoreActivator Operating System : Windows 10 10.0, amd64
[2023-04-02 19:35:39,657] []  INFO - CarbonCoreActivator Java Home        : C:\Program Files\Java\jdk1.8.0_291\jre
[2023-04-02 19:35:39,657] []  INFO - CarbonCoreActivator Java Version     : 1.8.0_291
[2023-04-02 19:35:39,657] []  INFO - CarbonCoreActivator Java VM          : Java HotSpot(TM) 64-Bit Server VM 25.291-b10,Oracle Corporation
[2023-04-02 19:35:39,657] []  INFO - CarbonCoreActivator Carbon Home      : C:\Development_Avecto\MUTUAL~1\WSO2EI~2.0\bin\..
[2023-04-02 19:35:39,657] []  INFO - CarbonCoreActivator Java Temp Dir    : C:\Development_Avecto\MUTUAL~1\WSO2EI~2.0\bin\..\wso2\tmp[2023-04-02 19:35:39,657] []  INFO - CarbonCoreActivator User             : 112002, en-IN, Asia/Calcutta
[2023-04-02 19:35:39,921] []  INFO - DefaultCryptoProviderComponent 'CryptoService.Secret' property has not been set. 'org.wso2.carbon.crypto.provider.SymmetricKeyInternalCryptoProvider' won't be registered as an internal crypto provider. Please set the secret if the provider needs to be registered.
[2023-04-02 19:35:39,952] []  INFO - GoogleTokenGenDSComponent Activating GoogleTokengen DS component
[2023-04-02 19:35:40,141] []  INFO - KafkaEventAdapterServiceDS Successfully deployed the Kafka output event adaptor service
[2023-04-02 19:35:44,303] []  INFO - EmbeddedRegistryService Configured Registry in 93ms
[2023-04-02 19:35:44,371] []  INFO - RegistryCoreServiceComponent Registry Mode    : READ-WRITE
[2023-04-02 19:35:48,084] []  INFO - SolrClient Default Embedded Solr Server Initialized
[2023-04-02 19:35:48,351] []  INFO - UserStoreMgtDSComponent Carbon UserStoreMgtDSComponent activated successfully.
[2023-04-02 19:36:06,272] []  INFO - TaglibUriRule TLD skipped. URI: http://tiles.apache.org/tags-tiles is already defined
[2023-04-02 19:36:07,579] []  INFO - ClusterBuilder Clustering has been disabled
[2023-04-02 19:36:07,844] []  INFO - UserStoreConfigurationDeployer User Store Configuration Deployer initiated.
[2023-04-02 19:36:07,844] []  INFO - UserStoreConfigurationDeployer User Store Configuration Deployer initiated.
[2023-04-02 19:36:08,582] []  INFO - VFSTransportSender VFS Sender started
[2023-04-02 19:36:08,614] []  INFO - PassThroughHttpSender Initializing Pass-through HTTP/S Sender...
[2023-04-02 19:36:08,661] []  INFO - PassThroughHttpSender Pass-through HTTP Sender started...
[2023-04-02 19:36:08,661] []  INFO - PassThroughHttpSSLSender Initializing Pass-through HTTP/S Sender...
[2023-04-02 19:36:08,661] [] ERROR - ClientConnFactoryBuilder FileNotFoundException - Could not load customSSLProfiles from file path: C:/Development_Avecto/mutualssl/wso2ei-6.5.0/repository/deployment/server/mutual_ssl_profiles.xml
java.io.FileNotFoundException: C:\Development_Avecto\MUTUAL~1\WSO2EI~2.0\C:\Development_Avecto\mutualssl\wso2ei-6.5.0\repository\deployment\server\mutual_ssl_profiles.xml (The filename, directory name, or volume label syntax is incorrect)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at java.io.FileInputStream.<init>(FileInputStream.java:93)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.<init>(StAXOMBuilder.java:148)
        at org.apache.synapse.transport.nhttp.config.ClientConnFactoryBuilder.loadDynamicSSLConfig(ClientConnFactoryBuilder.java:527)        at org.apache.synapse.transport.nhttp.config.ClientConnFactoryBuilder.getCustomSSLContexts(ClientConnFactoryBuilder.java:229)        at org.apache.synapse.transport.nhttp.config.ClientConnFactoryBuilder.parseSSL(ClientConnFactoryBuilder.java:195)
        at org.apache.synapse.transport.passthru.PassThroughHttpSSLSender.initConnFactoryBuilder(PassThroughHttpSSLSender.java:45)
        at org.apache.synapse.transport.passthru.PassThroughHttpSender.init(PassThroughHttpSender.java:167)
        at org.apache.synapse.transport.passthru.PassThroughHttpSSLSender.init(PassThroughHttpSSLSender.java:33)
        at org.apache.axis2.context.ConfigurationContextFactory.initTransportSenders(ConfigurationContextFactory.java:300)
        at org.apache.axis2.context.ConfigurationContextFactory.init(ConfigurationContextFactory.java:231)
        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:93)
        at org.wso2.carbon.core.CarbonConfigurationContextFactory.createNewConfigurationContext(CarbonConfigurationContextFactory.java:65)
        at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:401)
        at org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:220)
        at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate(CarbonCoreServiceComponent.java:105)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
        at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
        at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)
        at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
        at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
        at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
        at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
        at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
        at org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81)
        at org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40)
        at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.init(DelegationServlet.java:38)
        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1230)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1174)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1066)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5433)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5731)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1707)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1697)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

为什么

customSSLProfiles
中配置的
mutual_ssl_profiles.xml
没有加载或者指定文件路径时是否有错误?

请澄清一下。

wso2 wso2-esb axis2 wso2-enterprise-integrator mutual-authentication
1个回答
0
投票

首先,错误

The process cannot access the file because it is being used by another process.
表示文件正在被不同的进程使用。因此,我假设您启动的 Axis2 服务器锁定了一些 EI 和 Axis2Server 共有的依赖项。所以不确定它会影响运行时间。为了解决这个问题,创建一份 WSO2 EI (C:\Development_Avecto\mutualssl\wso2ei-6.5.0) 并从那里启动 Axis2 服务器。

关于SSlProfile的报错,好像是Path不对。

C:\Development_Avecto\MUTUAL~1\WSO2EI~2.0\C:\Development_Avecto\mutualssl\wso2ei-6.5.0\repository\deployment\server\mutual_ssl_profiles.xml
如您所见,CARBON_HOME(C:\Development_Avecto\MUTUAL~1\WSO2EI~2.0) 似乎已附加到您的路径中,因此这意味着服务器未将其识别为绝对路径。因此,尝试在 axis2 配置中给出一个相对路径,例如
repository\deployment\server\mutual_ssl_profiles.xml
.

我还注意到 CARBON_HOME (

C:\Development_Avecto\MUTUAL~1\WSO2EI~2.0\
) 与实际服务器位置 (
C:\Development_Avecto\mutualssl\wso2ei-6.5.0
) 不同。您可能还必须修复它。

© www.soinside.com 2019 - 2024. All rights reserved.