summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/pixelated/bitmask_libraries/certs.py4
-rw-r--r--service/pixelated/config/args.py1
-rw-r--r--service/pixelated/runserver.py6
3 files changed, 11 insertions, 0 deletions
diff --git a/service/pixelated/bitmask_libraries/certs.py b/service/pixelated/bitmask_libraries/certs.py
index caa166e2..ed597ca8 100644
--- a/service/pixelated/bitmask_libraries/certs.py
+++ b/service/pixelated/bitmask_libraries/certs.py
@@ -19,8 +19,12 @@ from leap.common import ca_bundle
from .config import AUTO_DETECT_CA_BUNDLE
+LEAP_CERT = None
+
def which_bundle(provider):
+ if LEAP_CERT:
+ return LEAP_CERT
return str(LeapCertificate(provider).auto_detect_ca_bundle())
diff --git a/service/pixelated/config/args.py b/service/pixelated/config/args.py
index 5bb01d90..4b0187ae 100644
--- a/service/pixelated/config/args.py
+++ b/service/pixelated/config/args.py
@@ -29,6 +29,7 @@ def parse():
parser.add_argument('-c', '--config', metavar='<configfile>', default=None, help='use specified file for credentials (for test purposes only)')
parser.add_argument('-sk', '--sslkey', metavar='<server.key>', default=None, help='use specified file for SSL key')
parser.add_argument('-sc', '--sslcert', metavar='<server.pem>', default=None, help='use specified file for SSL certificate')
+ parser.add_argument('-lc', '--leap-cert', metavar='<leap.ca.crt>', default=None, help='use specified file for LEAP certificate')
parser.add_argument('--register', metavar=('provider', 'username'),
nargs=2, help='register a new username on the desired provider')
args = parser.parse_args()
diff --git a/service/pixelated/runserver.py b/service/pixelated/runserver.py
index b6762177..e3cef396 100644
--- a/service/pixelated/runserver.py
+++ b/service/pixelated/runserver.py
@@ -43,8 +43,14 @@ app = App()
app.config = {}
+def setup_leap_cert(leap_cert):
+ import pixelated.bitmask_libraries.certs as certs
+ certs.LEAP_CERT = leap_cert
+
+
def setup():
args = input_args.parse()
+ setup_leap_cert(args.leap_cert)
setup_debugger(args.debug)
if args.register: