Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #322 from aandryashin/master
Browse files Browse the repository at this point in the history
Ability to add Root CAs.
  • Loading branch information
vania-pooh authored Dec 7, 2020
2 parents 4e9270d + 4e8aff9 commit 5ff15de
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
11 changes: 11 additions & 0 deletions static/chrome/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ clean() {

trap clean SIGINT SIGTERM

if env | grep -q ROOT_CA_; then
mkdir -p $HOME/.pki/nssdb
certutil -N --empty-password -d sql:$HOME/.pki/nssdb
for e in $(env | grep ROOT_CA_ | sed -e 's/=.*$//'); do
certname=$(echo -n $e | sed -e 's/ROOT_CA_//')
echo ${!e} | base64 -d >/tmp/cert.pem
certutil -A -n ${certname} -t "TCu,Cu,Tu" -i /tmp/cert.pem -d sql:$HOME/.pki/nssdb
rm /tmp/cert.pem
done
fi

/usr/bin/fileserver &
FILESERVER_PID=$!

Expand Down
17 changes: 17 additions & 0 deletions static/firefox/selenoid/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,21 @@ fi
DISPLAY="$DISPLAY" /usr/bin/selenoid -conf /home/selenium/browsers.json -disable-docker -timeout 1h -max-timeout 24h -enable-file-upload -capture-driver-logs &
SELENOID_PID=$!

if env | grep -q ROOT_CA_; then
while true; do
if certDB=$(ls -d /tmp/rust_mozprofile*/cert9.db 2>/dev/null); then
break
else
sleep 0.1
fi
done
certdir=$(dirname ${certDB})
for e in $(env | grep ROOT_CA_ | sed -e 's/=.*$//'); do
certname=$(echo -n $e | sed -e 's/ROOT_CA_//')
echo ${!e} | base64 -d >/tmp/cert.pem
certutil -A -n ${certname} -t "TCu,Cu,Tu" -i /tmp/cert.pem -d sql:${certdir}
rm /tmp/cert.pem
done
fi

wait

0 comments on commit 5ff15de

Please sign in to comment.