def ssl_config(module):
  """
  Creates a ssl config dictionary to be used for ssl auth.
  """
  ctx = module.params['ssl_auth']
  try:
    return {
      'cert': ctx['cert'],
      'serverca': ctx['serverca'],
      'no_ssl_verify': ctx.get('verify', True),
      'authtype': 'ssl'
    }
  except KeyError as e:
   module.fail_json(changed=False,
      skipped=False, 
      failed=True, 
      error='Missing ssl_auth "%s" key.' % e.args[0])