Skip to content

Commit

Permalink
Include --netrc-file when calling curl
Browse files Browse the repository at this point in the history
Resolves: latchset#401

Signed-off-by: Sergio Arroutbi <[email protected]>
  • Loading branch information
sarroutbi committed Jan 31, 2023
1 parent 0bb86d3 commit ce06b40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pins/tang/clevis-decrypt-tang
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ xfr="$(jose jwk exc -i '{"alg":"ECMR"}' -l- -r- <<< "$clt$eph")"

rec_url="$url/rec/$kid"
ct="Content-Type: application/jwk+json"
if ! rep="$(curl -sfg -X POST -H "$ct" --data-binary @- "$rec_url" <<< "$xfr")"; then
if ! rep="$(curl --netrc-file /root/.netrc -sfg -X POST -H "$ct" --data-binary @- "$rec_url" <<< "$xfr")"; then
echo "Error communicating with server $url" >&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion src/pins/tang/clevis-encrypt-tang
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ elif jws="$(jose fmt -j- -g adv -Su- <<< "$cfg")"; then
fi

thp="${thp:-any}"
elif ! jws="$(curl -sfg "$url/adv/$thp")"; then
elif ! jws="$(curl --netrc-file /root/.netrc -sfg "$url/adv/$thp")"; then
echo "Unable to fetch advertisement: '$url/adv/$thp'!" >&2
exit 1
fi
Expand Down

0 comments on commit ce06b40

Please sign in to comment.