 fs = require 'fs'
 {make_esc} = require 'iced-error'
 {E} = require './err'
+log = require './log'
 
 #=========================================================================
 

  constructor : (@file) ->

  open : (cb) ->
    await fs.readFile @file, defer err, @raw
    cb err


  #--------------------

  load : (cb) ->
    log.debug "+ Load proxy CAs"
    esc = make_esc cb, "CAs::init"
    await @read_env esc defer()
    await @open_files esc defer()
    @_ca_arr = (c.to_string() for c in @_cas)
    log.debug "- Loaded proxy CAs"
    cb null, (@_cas.length > 0)

  #--------------------
