【问题标题】:How to connect from client using CCDT and SSL to Remote Queue Manager (WebSphere MQ Server) using C#如何使用 CCDT 和 SSL 从客户端连接到使用 C# 的远程队列管理器(WebSphere MQ 服务器)
【发布时间】:2015-01-22 21:51:24
【问题描述】:

我对 IBM WebSphere MQ 还很陌生。

还有我的要求(如下):

1) 我想使用 KeyType 作为 CMS 创建和配置客户端证书、服务器证书、证书请求、证书颁发机构、密钥库。

2) 完成上述操作后,我需要为 SSL 配置远程队列管理器 (TLS_RSA_WITH_AES_128_CBC_SHA256)

2) 我将使用 C#.NET 代码通过 CCDT 方法进行连接。

如果有的话,我正在寻找上述的示例程序。

感谢和问候, 京东

【问题讨论】:

    标签: c#-4.0 certificate ssl-certificate keystore client-certificates


    【解决方案1】:

    我假设你已经有了你的 CCDT 文件,所以示例代码

    public void TestSSLConnectionWithCCDT()
            {
                try
                {
                    Environment.SetEnvironmentVariable("MQCHLLIB", @"D:\MQCCDT\QM_SSLConnect\");
                    Environment.SetEnvironmentVariable("MQCHLTAB", "AMQCLCHL.TAB");
    
                    Hashtable props = new Hashtable();
                    props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
                    props.Add(MQC.SSL_CERT_STORE_PROPERTY, sslKeyRepository);
                    MQQueueManager qMgr = new MQQueueManager("QM_SSLConnect", props);
    
                    MQQueue queue1 = qMgr.AccessQueue("XYZ", MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);
                    MQMessage msg = new MQMessage();
                    msg.WriteUTF("Test Message");
                    queue1.Put(msg);
                }
                catch (MQException ex)
                {
                    Console.WriteLine("WebSphere MQ error occurred: {0}", ex.ToString());
                }
                catch (System.Exception ex)
                {
                    Console.WriteLine("System error occurred: {0}", ex.ToString());
                }
            }
    

    您可以使用自签名证书测试传输级安全性,更多详情请点击链接http://2freeclear.wordpress.com/2014/11/29/transport-level-security-with-ibm-websphere-mq-in-net-environment/

    【讨论】:

      猜你喜欢
      • 2017-02-17
      • 2017-04-30
      • 1970-01-01
      • 1970-01-01
      • 2018-12-11
      • 1970-01-01
      • 2013-02-28
      • 2011-05-05
      • 2018-12-17
      相关资源
      最近更新 更多