MQRC_KEY_REPOSITORY_ERROR appear when connect to remote queue server with SSL

38 views Asked by At

I'm trying to create qManager from remote using c# language, the MQRC_KEY_REPOSITORY_ERROR pops up, here is my code:

connectionType is MQC.TRANSPORT_MQSERIES_MANAGED, and key path(C:\ssl\key) is accessale.

NOTE: MQRC_FUNCTION_NOT_SUPPORTED when TRANSPORT_MQSERIES_CLIENT

public Hashtable GetConnectionProperties(WMQConnectionConfig config)
{
    Hashtable connProperties = new()
    {
        // Add the connection type
        { MQC.TRANSPORT_PROPERTY, config.ConnectionType }
    };

    // Set up the rest of the connection properties, based on the
    // connection type requested
    switch (config.ConnectionType)
    {
        case MQC.TRANSPORT_MQSERIES_BINDINGS:
            break;
        case MQC.TRANSPORT_MQSERIES_CLIENT:
        case MQC.TRANSPORT_MQSERIES_XACLIENT:
        case MQC.TRANSPORT_MQSERIES_MANAGED:
            connProperties.Add(MQC.HOST_NAME_PROPERTY, config.HostName);
            connProperties.Add(MQC.CHANNEL_PROPERTY, config.ChannelName);
            connProperties.Add(MQC.PORT_PROPERTY, config.Port);
            
            //connProperties.Add(MQC.SSL_CIPHER_SUITE_PROPERTY, cipherSuite);
        
            connProperties.Add(MQC.SSL_CERT_STORE_PROPERTY, config.SSLKeyRepository);
            connProperties.Add(MQC.SSL_CERT_STORE_PASSWORD_PROPERTY, config.SSLKeyRepositoryPassword);
            connProperties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, config.SSLCipherSpec);
            break;
    }

    MQEnvironment.UserId = config.UserId;
    MQEnvironment.Password = config.Password;

    return connProperties;
}

public MQQueueManager GetQueueManager(WMQConnectionConfig config)
{
    var connProperties = this.GetConnectionProperties(config);
    MQQueueManager mqQueueManager = new(config.QueueMangerName, connProperties);

    return mqQueueManager;
}
0

There are 0 answers