diff --git a/swh/vault/api/server.py b/swh/vault/api/server.py
--- a/swh/vault/api/server.py
+++ b/swh/vault/api/server.py
@@ -199,12 +199,7 @@
     return app
 
 
-def get_local_backend(config_file):
-    if os.path.isfile(config_file):
-        cfg = config.read(config_file, DEFAULT_CONFIG)
-    else:
-        cfg = config.load_named_config(config_file, DEFAULT_CONFIG)
-
+def get_local_backend(cfg):
     if 'vault' not in cfg:
         raise ValueError("missing '%vault' configuration")
 
@@ -231,7 +226,11 @@
 
 def make_app_from_configfile(config_file=DEFAULT_CONFIG_PATH, **kwargs):
     config_file = os.environ.get('SWH_CONFIG_FILENAME', config_file)
-    vault = get_local_backend(config_file)
+    if os.path.isfile(config_file):
+        cfg = config.read(config_file, DEFAULT_CONFIG)
+    else:
+        cfg = config.load_named_config(config_file, DEFAULT_CONFIG)
+    vault = get_local_backend(cfg)
     return make_app(backend=vault, **kwargs)