简体   繁体   English

IBM WebSphere Liberty 处理 IHS 服务器证书问题

[英]IBM WebSphere Liberty working with IHS Server Problems with Certificate(s)

I have a liberty server and an IHS server (both on different hosts).我有一个自由服务器和一个 IHS 服务器(都在不同的主机上)。 This is on rhel7.这是在rhel7上。

I've followed a number of guides that I found that walk thru the setup of keystores and sharing of certs but still run into issues.我遵循了许多指南,我发现这些指南通过设置密钥库和共享证书,但仍然遇到问题。 For reference, I tried the methods detailed https://jazz.net/wiki/bin/view/Deployment/CreateIHSPLUGINFORLIBERTYPROFILE and https://www.ibm.com/support/knowledgecenter/en/SSEQTJ_9.0.5/com.ibm.websphere.ihs.doc/ihs/tihs_install_config_liberty.html .作为参考,我尝试了详细的方法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

A quick summary of what I have done this past attempt... On the liberty server I added the following to my server.xml to add a plugin include (to keep things easier to read):对我过去尝试所做的工作的快速总结......在自由服务器上,我将以下内容添加到我的 server.xml 以添加一个插件包含(使内容更易于阅读):

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

And the 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"/>

On my IHS server the path for the root Plugin directory is as indicated above in the file at /opt/IBM/wasadmin/Plugins and the plugin-key.kdb and plugin-key.sth are located in the locations listed above.在我的 IHS 服务器上,根插件目录的路径如上面 /opt/IBM/wasadmin/Plugins 文件中所示,plugin-key.kdb 和 plugin-key.sth 位于上面列出的位置。

I reboot the liberty server and it generated the plugin-cfg.xml in the logs/state directory:我重新启动了 Liberty 服务器,它在日志/状态目录中生成了 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"/>

I copy the plugin-cfg.xml over to the IHS server at /opt/IBM/wasadmin/Plugins/config/webserver1/plugin-cfg.xml我将 plugin-cfg.xml 复制到位于 /opt/IBM/wasadmin/Plugins/config/webserver1/plugin-cfg.xml 的 IHS 服务器

The plugin stuff works only the SSL portion between IHS and the app server give me issues.插件的东西只适用于 IHS 和应用服务器之间的 SSL 部分给我带来了问题。

On the IHS server I have created the plugin-key.kdb keystore with stash plugin-key.sth and imported the cert I extracted from the liberty server /opt/IBM/wlp/usr/servers/app/resources/security/key.p12 the default personal cert and copy it to the IHS server and add the default liberty cert to the plugin-key.kdb keystore.在 IHS 服务器上,我使用 stash plugin-key.sth 创建了 plugin-key.kdb 密钥库,并导入了我从自由服务器 /opt/IBM/wlp/usr/servers/app/resources/security/key 中提取的证书。 p12 默认个人证书并将其复制到 IHS 服务器并将默认自由证书添加到 plugin-key.kdb 密钥库。

At the bottom of the httpd.conf is: 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

I bounce the apachectl and go to the url for the application on port 8443 https://hostname:8443/app/ui and get a "500 Internal Server Error".我退回 apachectl 并转到端口 8443 https://hostname:8443/app/ui上的应用程序的 url 并收到“500 内部服务器错误”。

The http_plugin.log plugin logs show: 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

Thank you!谢谢!

You said "imported" I assume this means an "add" operation in ikeyman/gskcmd/gskcapicmd?你说“导入”我认为这意味着 ikeyman/gskcmd/gskcapicmd 中的“添加”操作? The two verbs in these tools have a different meaning.这些工具中的两个动词具有不同的含义。

I suspect you added the issued certificate (CN=hostname...) instead of the CA that issued the certificate (memberroot).我怀疑您添加了颁发的证书(CN=hostname...)而不是颁发证书的 CA(memberroot)。 The debug information in the WAS Plugin message implies that it couldn't chase the certificate up to a trusted root (as opposed to finding some X509 error w/ the root it had access to). WAS Plugin 消息中的调试信息意味着它无法将证书追踪到受信任的根(而不是在它有权访问的根上找到一些 X509 错误)。

But, it could also be that you imported the "wrong" certificate with cn=memberroot.但是,也可能是您使用 cn=memberroot 导入了“错误”的证书。 WebSphere does not always add the necessary Subject Key Identifier/Authority Key Identifier to be sure, so check carefully. WebSphere 并不总是添加必要的主题密钥标识符/权威密钥标识符来确定,因此请仔细检查。

Ok, I got this working finally.好的,我终于得到了这个工作。 It seems having a collective setup which used DefaultKeyStore id was somehow causing conflict with my Liberty plugin keystore.似乎有一个使用 DefaultKeyStore id 的集体设置以某种方式导致与我的 Liberty 插件密钥库发生冲突。

I ended up re-creating everything (plugin-key.kdb keystore and the liberty plugin keystore which I named LibertyKeystore.jks).我最终重新创建了所有内容(plugin-key.kdb 密钥库和我命名为 LibertyKeystore.jks 的自由插件密钥库)。 I dumped the collective stuff (not needed at this time anyways) and made an include as above called plugin-join-include.xml:我抛弃了集体的东西(无论如何此时不需要)并创建了一个名为 plugin-join-include.xml 的包含:

<?xml version="1.0" encoding="UTF-8" ?>
<server description="IHS plugin join include file">

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

        <keyStore id="defaultKeyStore" password="password"
                location="${server.config.dir}/resources/security/LibertyKeystore.jks" />

        <pluginConfiguration webserverPort="80" webserverSecurePort="8443"
                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="LibertyKeystore"/>

</server>

I exchanged keys between the liberty server LibertyKeystore.jks and the IHS plugin-key.kdb keystores and pushed the newly generated plugin to the IHS server and bounced everything and it all seems to function without issue.我在自由服务器 LibertyKeystore.jks 和 IHS plugin-key.kdb 密钥库之间交换了密钥,并将新生成的插件推送到 IHS 服务器,并弹回了所有内容,一切似乎都没有问题。

I do now notice in the /opt/IBM/wasadmin/HTTPServer/logs the error log streams:我现在注意到 /opt/IBM/wasadmin/HTTPServer/logs 中的错误日志流:

[Wed Mar 04 21:32:28 2020] [error] [client xxx.xx.xx.17:65261] [7ff5a0000910] [19831] SSL0279E: SSL Handshake Failed due to fatal alert from client. Client sent fatal alert [level 2 (fatal), description 46 (certificate_unknown)]  [xxx.xx.xx.17:65261 -> xxx.xx.xx.87:8443] [21:32:28.000934048] 0ms

The access logs show 200's.访问日志显示 200 个。 Maybe a non plugin "issue" at this point.此时可能是非插件“问题”。

暂无
暂无

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

相关问题 WebSphere + IHS重定向不起作用 - WebSphere + IHS Redirect not working 使用IBM WebSphere和IBM IHS进行mod_deflate - mod_deflate with IBM WebSphere and IBM IHS 使用IBM WebSphere Application Server Liberty Profile配置Mysql DataSource - Configuring Mysql DataSource with IBM WebSphere Application Server Liberty Profile 应用程序如何判断它是否在IBM WebSphere Application Server或IBM WebSphere Liberty Profile上运行? - How can an application tell if its running on IBM WebSphere Application Server or IBM WebSphere Liberty Profile? IHS Web服务器连接到Websphere应用程序服务器 - IHS webserver connecting to websphere application server WebSphere Application Server for Developers与IBM WebSphere SDK Java 7 for Liberty和完整概要文件的区别 - difference for WebSphere Application Server for Developers VS IBM WebSphere SDK Java 7 for Liberty and Full profile IBM websphere liberty 服务器中的错误 SRVE0315E 表示什么? - What does error SRVE0315E indicate in ibm websphere liberty server? IBM WebSphere Liberty Datasource 是否可以从 server.xml 拆分为一个包含文件? - Can IBM WebSphere Liberty Datasource be split from the server.xml into an include file? IBM Websphere Liberty Profile:如何在Websphere中映射公共IP地址 - IBM Websphere Liberty Profile:How to map Public IP Address in Websphere 如何在Websphere Application Server Liberal v。8.5.5.0中生成新的SSL证书 - how to generate new SSL certificate in websphere application server liberty v. 8.5.5.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM