Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ai
autoca
Commits
2bec7494
Commit
2bec7494
authored
Jan 07, 2012
by
ale
Browse files
allow the user to provide a shared secret for authentication
parent
fa26c3af
Changes
1
Show whitespace changes
Inline
Side-by-side
autoca/ca_tool.py
View file @
2bec7494
import
optparse
import
os
import
logging
import
sys
from
OpenSSL
import
crypto
...
...
@@ -30,13 +31,21 @@ def main():
parser
.
add_option
(
'--subject'
,
dest
=
'subject'
,
help
=
'specify the X.509 subject as a set of '
'comma-separated ATTR=VALUE assignments'
)
parser
.
add_option
(
'--secret'
,
dest
=
'secret'
,
help
=
'shared secret for authentication'
)
opts
,
args
=
parser
.
parse_args
()
if
len
(
args
)
<
1
:
parser
.
error
(
'No command specified'
)
if
not
opts
.
url
:
parser
.
error
(
'Must specify --url'
)
ca
=
ca_stub
.
CaStub
(
opts
.
url
)
secret
=
opts
.
secret
if
not
secret
:
if
os
.
getenv
(
'AUTOCA_SECRET'
):
with
open
(
os
.
getenv
(
'AUTOCA_SECRET'
),
'r'
)
as
fd
:
secret
=
fd
.
read
().
strip
()
ca
=
ca_stub
.
CaStub
(
opts
.
url
,
secret
)
cmd
,
args
=
args
[
0
],
args
[
1
:]
if
cmd
==
'get-ca'
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment