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

Ability to add Root CAs. #322

Merged
merged 1 commit into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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