MQSeries Docker 图像:没有验证的队列管理器
MQSeries Docker image: queue manager without authentication
如何让队列管理器(默认存在于 docker 图像中)接受任何未经身份验证的连接?
我浏览了 Web 控制台 (:9443/ibmmq/console/) 中的所有选项并尝试了任何我认为可能具有我想要的效果但找不到的东西。
TIA 和 BR,
克里斯蒂安
编辑:这是我用来连接的代码
JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
JmsConnectionFactory cf = ff.createConnectionFactory();
// Set the properties
cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);
cf.setIntProperty(WMQConstants.WMQ_PORT, PORT);
cf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);
cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);
cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, "JmsPutGet (JMS)");
//cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);
//cf.setStringProperty(WMQConstants.USERID, APP_USER);
//cf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);
// Create JMS objects
context = cf.createContext();
------------编辑------------
之后的错误日志
- 为 QM
删除 "connection authentication"
- 设置频道授权。记录(扩展)到 "As Queue Manager"
AMQ9557E: Queue Manager User ID initialization failed for '[my OS user]'.
EXPLANATION:
The call to initialize the User ID '[my OS user]' failed with CompCode 2 and
Reason 2035. If an MQCSP block was used, the User ID in the MQCSP block was ''.
ACTION:
Correct the error and try again.
如果您试图禁用 MQ 连接身份验证功能以便不对用户 ID 和密码进行身份验证,那么您可以通过在 runmqsc 中针对队列管理器执行以下 MQSC 命令来执行此操作。
ALTER QMGR CONNAUTH(' ')
REFRESH SECURITY(*) TYPE(CONAUTH)
或者在 MQ Web 控制台中:
- Select 您在队列管理器小部件中的队列管理器
- 单击属性
- 转到扩展部分并向下滚动
- 将 "Connection Authentication" 属性设置为空值
- 点击保存然后关闭
- Select 您在队列管理器 widgit 中的队列管理器
- 单击下拉菜单中的
...
和 select 刷新安全性
- "Select connection authentication"
- 添加小部件:"Channel authentication records"
- 在此小部件中,select 您频道的条目,单击 "Extended" 下的属性,将客户端连接设置为 "As Queue Manager"
如果需要:
Select 您的 QM 在 "Queue Manager" 小部件中,打开属性 (...),"refresh security...","Connection authentication"。
确保在 MCA 下的频道属性中设置默认用户名(在标准 docker 安装中,即 "app")(如@JoshMc 所建议)
运行 按照 mqsc 命令禁用 IBM MQ 服务器中的通道身份验证:
ALTER QMGR CHLAUTH(DISABLED)
ALTER QMGR CONNAUTH(' ')
REFRESH SECURITY TYPE(CONNAUTH)
如何让队列管理器(默认存在于 docker 图像中)接受任何未经身份验证的连接?
我浏览了 Web 控制台 (:9443/ibmmq/console/) 中的所有选项并尝试了任何我认为可能具有我想要的效果但找不到的东西。
TIA 和 BR, 克里斯蒂安
编辑:这是我用来连接的代码
JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
JmsConnectionFactory cf = ff.createConnectionFactory();
// Set the properties
cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, HOST);
cf.setIntProperty(WMQConstants.WMQ_PORT, PORT);
cf.setStringProperty(WMQConstants.WMQ_CHANNEL, CHANNEL);
cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, QMGR);
cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, "JmsPutGet (JMS)");
//cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);
//cf.setStringProperty(WMQConstants.USERID, APP_USER);
//cf.setStringProperty(WMQConstants.PASSWORD, APP_PASSWORD);
// Create JMS objects
context = cf.createContext();
------------编辑------------
之后的错误日志- 为 QM 删除 "connection authentication"
- 设置频道授权。记录(扩展)到 "As Queue Manager"
AMQ9557E: Queue Manager User ID initialization failed for '[my OS user]'.
EXPLANATION:
The call to initialize the User ID '[my OS user]' failed with CompCode 2 and
Reason 2035. If an MQCSP block was used, the User ID in the MQCSP block was ''.
ACTION:
Correct the error and try again.
如果您试图禁用 MQ 连接身份验证功能以便不对用户 ID 和密码进行身份验证,那么您可以通过在 runmqsc 中针对队列管理器执行以下 MQSC 命令来执行此操作。
ALTER QMGR CONNAUTH(' ')
REFRESH SECURITY(*) TYPE(CONAUTH)
或者在 MQ Web 控制台中:
- Select 您在队列管理器小部件中的队列管理器
- 单击属性
- 转到扩展部分并向下滚动
- 将 "Connection Authentication" 属性设置为空值
- 点击保存然后关闭
- Select 您在队列管理器 widgit 中的队列管理器
- 单击下拉菜单中的
...
和 select 刷新安全性 - "Select connection authentication"
- 添加小部件:"Channel authentication records"
- 在此小部件中,select 您频道的条目,单击 "Extended" 下的属性,将客户端连接设置为 "As Queue Manager"
如果需要:
Select 您的 QM 在 "Queue Manager" 小部件中,打开属性 (...),"refresh security...","Connection authentication"。 确保在 MCA 下的频道属性中设置默认用户名(在标准 docker 安装中,即 "app")(如@JoshMc 所建议)
运行 按照 mqsc 命令禁用 IBM MQ 服务器中的通道身份验证:
ALTER QMGR CHLAUTH(DISABLED)
ALTER QMGR CONNAUTH(' ')
REFRESH SECURITY TYPE(CONNAUTH)