IBM WebSphere Liberty使用IHS Server的证书有问题

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

我有一个自由服务器和一个IHS服务器(都在不同的主机上)。这是在rhel7上。

我遵循了许多指南,发现它们可以通过设置密钥库和共享证书进行操作,但是仍然遇到问题。作为参考,我尝试了详细的https://jazz.net/wiki/bin/view/Deployment/CreateIHSPLUGINFORLIBERTYPROFILEhttps://www.ibm.com/support/knowledgecenter/en/SSEQTJ_9.0.5/com.ibm.websphere.ihs.doc/ihs/tihs_install_config_liberty.html方法。

关于过去尝试的简要总结...在自由服务器上,我将以下内容添加到server.xml中以添加插件include(以使内容易于阅读):

<include location="${server.config.dir}/plugin-join-include.xml" />

和plugin-join-include.xml:

        <featureManager>
                <feature>ssl-1.0</feature>
        </featureManager>

        <keyStore id="libertyKey" password="xxxx"
              location="${server.config.dir}/resources/security/libkey.jks"/>

        <pluginConfiguration webserverPort="10500" webserverSecurePort="10447"
                pluginInstallRoot="/opt/IBM/wasadmin/Plugins"
                sslKeyRingLocation="/opt/IBM/wasadmin/Plugins/config/webserver1/plugin-key.kdb"
                sslStashFileLocation="/opt/IBM/wasadmin/Plugins/config/webserver1/plugin-key.sth"
                sslCertlabel="libertyKey"/>

在我的IHS服务器上,根插件目录的路径如上面在/ opt / IBM / wasadmin / Plugins中的文件中所示,plugin-key.kdb和plugin-key.sth位于上面列出的位置。

我重新启动自由服务器,并在logs / state目录中生成了plugin-cfg.xml:

<?xml version="1.0" encoding="UTF-8"?><!--HTTP server plugin config file for app generated on 2020.03.04 at 12:32:02 UTC-->
<Config ASDisableNagle="false" AcceptAllContent="false" AppServerPortPreference="HostHeader" ChunkedResponse="false" ConfigHash="1077723051" FIPSEnable="false" IISDisableNagle="false" IISPluginPriority="High" IgnoreDNSFailures="false" RefreshInterval="60" ResponseChunkSize="64" SSLConsolidate="false" TrustedProxyEnable="false" VHostMatchingCompat="false">
   <Log LogLevel="Error" Name="/opt/IBM/wasadmin/Plugins/logs/webserver1/http_plugin.log"/>
   <Property Name="ESIEnable" Value="true"/>
   <Property Name="ESIMaxCacheSize" Value="1024"/>
   <Property Name="ESIInvalidationMonitor" Value="false"/>
   <Property Name="ESIEnableToPassCookies" Value="false"/>
   <Property Name="PluginInstallRoot" Value="/opt/IBM/wasadmin/Plugins"/>
<!-- Configuration generated using httpEndpointRef=defaultHttpEndpoint-->
<!-- The default_host contained only aliases for endpoint defaultHttpEndpoint.
         The generated VirtualHostGroup will contain only configured web server ports:
                webserverPort=10500
                webserverSecurePort=10447 -->
   <VirtualHostGroup Name="default_host">
      <VirtualHost Name="*:10500"/>
      <VirtualHost Name="*:10447"/>
   </VirtualHostGroup>
   <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="true" LoadBalance="Round Robin" Name="affms_default_node_Cluster" PostBufferSize="0" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60" ServerIOTimeoutRetry="-1">
      <Server CloneID="412b3187-16c4-41b0-86e8-1e327c1c6b1b" ConnectTimeout="5" ExtendedHandshake="false" LoadBalanceWeight="20" MaxConnections="-1" Name="default_node_affms" ServerIOTimeout="900" WaitForContinue="false">
         <Transport Hostname="libertyhost" Port="10500" Protocol="http"/>
         <Transport Hostname="libertyhost" Port="10447" Protocol="https">
            <Property Name="keyring" Value="/opt/IBM/wasadmin/Plugins/config/webserver1/plugin-key.kdb"/>
            <Property Name="stashfile" Value="/opt/IBM/wasadmin/Plugins/config/webserver1/plugin-key.sth"/>
            <Property Name="certLabel" Value="libertyKey"/>
         </Transport>
      </Server>
      <PrimaryServers>
         <Server Name="default_node_app"/>
      </PrimaryServers>
   </ServerCluster>
   <UriGroup Name="default_host_app_default_node_Cluster_URIs">
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/app/ui/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/adminCenter/*"/>
   </UriGroup>
   <Route ServerCluster="app_default_node_Cluster" UriGroup="default_host_app_default_node_Cluster_URIs" VirtualHostGroup="default_host"/>

我将plugin-cfg.xml复制到/opt/IBM/wasadmin/Plugins/config/webserver1/plugin-cfg.xml的IHS服务器上

该插件仅在IHS和应用服务器之间的SSL部分起作用,给我带来了问题。

在IHS服务器上,我用stash plugin-key.sth创建了plugin-key.kdb密钥库,并导入了从自由服务器/ opt / IBM / wlp / usr / servers / app / resources / security /中提取的证书。 key.p12默认的个人证书,并将其复制到IHS服务器,并将默认的自由证书添加到plugin-key.kdb密钥库。

httpd.conf的底部是:

LoadModule was_ap22_module /opt/IBM/wasadmin/Plugins/bin/64bits/mod_was_ap22_http.so
WebSpherePluginConfig /opt/IBM/wasadmin/Plugins/config/webserver1/plugin-cfg.xml

我反弹apachectl,并在端口8443 https://hostname:8443/app/ui上转到应用程序的URL,并收到“ 500 Internal Server Error”。

http_plugin.log插件日志显示:

[04/Mar/2020:18:23:48.31652] 00002f26 3cff9700 - ERROR: lib_stream: openStream: Failed in r_gsk_secure_soc_init: GSK_ERROR_BAD_CERT(gsk rc = 414) PARTNER CERTIFICATE DN=CN=hostname,OU=app,O=ibm,C=us, Serial=xxxxxxxxxxx
[04/Mar/2020:18:23:48.31655] 00002f26 3cff9700 - ERROR: Ensure correct certificate is marked as default certificate in plugin-key.kdb.                           Consult documentation regarding Administering application security and Securing communications for more information.
[04/Mar/2020:18:23:48.31657] 00002f26 3cff9700 - ERROR: Last validation error [575010]: GSKVAL_ERROR_NO_CHAIN_BUILT
[04/Mar/2020:18:23:48.31658] 00002f26 3cff9700 - ERROR: Subject [[Class=]GSKVALMethod::PKIX[Issuer=]OU=memberRoot,O=xxxx-xxx-xxx-xxx-xxxxxxxx,DC=com.ibm.ws.collective[#=]082d6a83e5ec[Subject=]CN=hostname,OU=app,O=ibm,C=us] failed certificate validation
[04/Mar/2020:18:23:48.31659] 00002f26 3cff9700 - ERROR: X509 Certificate validation log: [[Class=]GSKVALMethod::PKIX[Time=]2020:3:4:18:23:48.316[buildChain=][Error=]GSKVAL_ERR_NO_CHAIN_BUILT[Info=]OU=memberRoot,O=xxx-xxx-xxx-xxx-xxx,DC=com.ibm.ws.collective[Cert=][Issuer=]OU=memberRoot,O=xxx-xxx-xxx-xxx-xxxx,DC=com.ibm.ws.collective[#=]082d6a83e5ec[Subject=]CN=hostname,OU=app,O=ibm,C=us[=Cert][=buildChain]^M
]
[04/Mar/2020:18:23:48.31664] 00002f26 3cff9700 - ERROR: ws_common: websphereGetStream: Could not open stream
[04/Mar/2020:18:23:48.31667] 00002f26 3cff9700 - ERROR: ws_common: websphereExecute: Failed to create the stream
[04/Mar/2020:18:23:48.31668] 00002f26 3cff9700 - ERROR: ws_common: websphereHandleRequest: Failed to execute the transaction to 'default_node_app' on host 'hostname:10447'; will try another one
[04/Mar/2020:18:23:48.31669] 00002f26 3cff9700 - ERROR: ws_common: websphereWriteRequestReadResponse: Failed to find an app server to handle this request
[04/Mar/2020:18:23:48.31670] 00002f26 3cff9700 - ERROR: ESI: getResponse: failed to get response: rc = 2
[04/Mar/2020:18:23:48.31671] 00002f26 3cff9700 - ERROR: [xxx.xx.xx.17://app/ui/] ws_common: websphereHandleRequest: Failed to handle request rc=2

谢谢!

websphere websphere-liberty ibmhttpserver ibm
1个回答
0
投票

[您说的是“导入”,我认为这意味着在ikeyman / gskcmd / gskcapicmd中是“添加”操作?这些工具中的两个动词具有不同的含义。

我怀疑您添加了颁发的证书(CN = hostname ...),而不是颁发证书的CA(memberroot)。 WAS插件消息中的调试信息表示它无法将证书追至受信任的根目录(而不是找到一些X509错误(带有可访问的根目录))。

但是,也可能是您使用cn = memberroot导入了“错误的”证书。 WebSphere不一定总是添加必要的主题密钥标识符/授权密钥标识符,因此请仔细检查。

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