def _load_encryption(proxy_conf_file, **kwargs):
 _debug('Setting configuration for encryption')
 conf = ConfigParser()
 conf.read(proxy_conf_file)
 try:
  section = 'pipeline:main'
  pipeline = conf.get(section, 'pipeline')
  pipeline = pipeline.replace('proxy-logging proxy-server', 'keymaster encryption proxy-logging proxy-server')
  conf.set(section, 'pipeline', pipeline)
  root_secret = os.urandom(32).encode('base64')
  conf.set('filter:keymaster', 'encryption_root_secret', root_secret)
 except NoSectionError as err:
  msg = ('Error problem with proxy conf file %s: %s' % (proxy_conf_file, err))
  raise InProcessException(msg)
 test_conf_file = os.path.join(_testdir, 'proxy-server.conf')
 with open(test_conf_file, 'w') as fp:
  conf.write(fp)
 return test_conf_file

def _load_encryption ( proxy_conf_file , ** kwargs ) : _debug ( 'Setting configuration for encryption' ) conf = ConfigParser ( ) conf . read ( proxy_conf_file ) try : section = 'pipeline:main' pipeline = conf . get ( section , 'pipeline' ) pipeline = pipeline . replace ( 'proxy-logging proxy-server' , 'keymaster encryption proxy-logging proxy-server' ) conf . set ( section , 'pipeline' , pipeline ) root_secret = os . urandom ( 32 ) . encode ( 'base64' ) conf . set ( 'filter:keymaster' , 'encryption_root_secret' , root_secret ) except NoSectionError as err : msg = ( 'Error problem with proxy conf file %s: %s' % ( proxy_conf_file , err ) ) raise InProcessException ( msg ) test_conf_file = os . path . join ( _testdir , 'proxy-server.conf' ) with open ( test_conf_file , 'w' ) as fp : conf . write ( fp ) return test_conf_file
load encryption configuration and override proxy-server .