Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
5e165819
Commit
5e165819
authored
May 13, 2019
by
Maarten den Braber
Browse files
Update authentication logic / info
parent
f9e3a213
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_acmeproxy.sh
View file @
5e165819
...
@@ -51,13 +51,19 @@ _acmeproxy_request() {
...
@@ -51,13 +51,19 @@ _acmeproxy_request() {
_saveaccountconf_mutable ACMEPROXY_USERNAME
"
$ACMEPROXY_USERNAME
"
_saveaccountconf_mutable ACMEPROXY_USERNAME
"
$ACMEPROXY_USERNAME
"
_saveaccountconf_mutable ACMEPROXY_PASSWORD
"
$ACMEPROXY_PASSWORD
"
_saveaccountconf_mutable ACMEPROXY_PASSWORD
"
$ACMEPROXY_PASSWORD
"
## Base64 encode the credentials
if
[
-z
"
$ACMEPROXY_USERNAME
"
]
||
[
-z
"
$ACMEPROXY_PASSWORD
"
]
;
then
credentials
=
$(
printf
"%b"
"
$ACMEPROXY_USERNAME
:
$ACMEPROXY_PASSWORD
"
| _base64
)
_info
"ACMEPROXY_USERNAME and/or ACMEPROXY_PASSWORD not set - using without client authentication! Make sure you're using server authentication (e.g. IP-based)"
export
_H1
=
"Accept: application/json"
export
_H2
=
"Content-Type: application/json"
else
## Base64 encode the credentials
credentials
=
$(
printf
"%b"
"
$ACMEPROXY_USERNAME
:
$ACMEPROXY_PASSWORD
"
| _base64
)
## Construct the HTTP Authorization header
## Construct the HTTP Authorization header
export
_H1
=
"Authorization: Basic
$credentials
"
export
_H1
=
"Authorization: Basic
$credentials
"
export
_H2
=
"Accept: application/json"
export
_H2
=
"Accept: application/json"
export
_H3
=
"Content-Type: application/json"
export
_H3
=
"Content-Type: application/json"
fi
## Add the challenge record to the acmeproxy grid member
## Add the challenge record to the acmeproxy grid member
response
=
"
$(
_post
"{
\"
fqdn
\"
:
\"
$fulldomain
.
\"
,
\"
value
\"
:
\"
$txtvalue
\"
}"
"
$ACMEPROXY_ENDPOINT
/
$action
"
""
"POST"
)
"
response
=
"
$(
_post
"{
\"
fqdn
\"
:
\"
$fulldomain
.
\"
,
\"
value
\"
:
\"
$txtvalue
\"
}"
"
$ACMEPROXY_ENDPOINT
/
$action
"
""
"POST"
)
"
...
...
Write
Preview
Markdown
is supported
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