diff options
author | Duda Dornelles <dudassdornelles@gmail.com> | 2015-01-23 12:35:38 -0200 |
---|---|---|
committer | Pixpoa pairing <pixpoapairing@pixelated-project.org> | 2015-01-23 12:35:47 -0200 |
commit | 1b0187052463e163706ed5bda36c62d1e2b1e3f2 (patch) | |
tree | 95b47f2c909464a38d8e94cbd75cf8831289b811 | |
parent | 3946100dbf2e61c4ee55067ad801c89626a7b3f9 (diff) |
plaftform #53 adding --leap-cert option to UA
-rw-r--r-- | service/pixelated/bitmask_libraries/certs.py | 4 | ||||
-rw-r--r-- | service/pixelated/config/args.py | 1 | ||||
-rw-r--r-- | service/pixelated/runserver.py | 6 |
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: |