(config, logger)
return queue_manager
Get the connection with SSL
Get the connection with SSL
Get the connection with SSL
def get_ssl_connection(config, logger):
    # type: (IBMMQConfig, CheckLoggingAdapter) -> pymqi.QueueManager
    """
    Get the connection with SSL
    """
    cd = _get_channel_definition(config)
    cd.SSLCipherSpec = pymqi.ensure_bytes(config.ssl_cipher_spec)

    sco = pymqi.SCO()
    sco.KeyRepository = pymqi.ensure_bytes(config.ssl_key_repository_location)

    if config.ssl_certificate_label:
        sco.CertificateLabel = pymqi.ensure_bytes(config.ssl_certificate_label)

    connect_options = {}
    if config.username and config.password:
        connect_options.update(
            {
                'user': config.username,
                'password': config.password,
            }
        )

    logger.debug(
        "Create SSL connection with ConnectionName=%s, ChannelName=%s, Version=%s, SSLCipherSpec=%s, "
        "KeyRepository=%s, CertificateLabel=%s, user=%s",
        cd.ConnectionName,
        cd.ChannelName,
        cd.Version,
        cd.SSLCipherSpec,
        sco.KeyRepository,
        sco.CertificateLabel,
        connect_options.get('user'),
    )
    queue_manager = pymqi.QueueManager(None)
    queue_manager.connect_with_options(config.queue_manager_name, cd, sco, **connect_options)
    return queue_manager
def get_ssl_connection ( config , logger ) : # type: (IBMMQConfig, CheckLoggingAdapter) -> pymqi.QueueManager cd = _get_channel_definition ( config ) cd . SSLCipherSpec = pymqi . ensure_bytes ( config . ssl_cipher_spec ) sco = pymqi . SCO ( ) sco . KeyRepository = pymqi . ensure_bytes ( config . ssl_key_repository_location ) if config . ssl_certificate_label : sco . CertificateLabel = pymqi . ensure_bytes ( config . ssl_certificate_label ) connect_options = { } if config . username and config . password : connect_options . update ( { 'user' : config . username , 'password' : config . password , } ) logger . debug ( "Create SSL connection with ConnectionName=%s, ChannelName=%s, Version=%s, SSLCipherSpec=%s, " "KeyRepository=%s, CertificateLabel=%s, user=%s" , cd . ConnectionName , cd . ChannelName , cd . Version , cd . SSLCipherSpec , sco . KeyRepository , sco . CertificateLabel , connect_options . get ( 'user' ) , ) queue_manager = pymqi . QueueManager ( None ) queue_manager . connect_with_options ( config . queue_manager_name , cd , sco , * * connect_options ) return queue_manager