Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ci 'TLS check' job is broken #1970

Merged
merged 1 commit into from
Oct 27, 2023
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
17 changes: 6 additions & 11 deletions .github/workflows/tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,17 @@ jobs:
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
sudo apt-get update
sudo apt-get install -y apache2-utils openssl
mkdir -p test/data
cd test/data
../scripts/gen_certs.sh
htpasswd -bBn test test123 > htpasswd
- name: Check for TLS settings
continue-on-error: true
run: |
cd $GITHUB_WORKSPACE
make binary
bin/zot-linux-amd64 serve examples/config-tls.json &
bin/zot-linux-amd64 serve examples/config-tls.json & echo $! > zot.PID
sleep 5
curl -kv --tls-max 1.0 -0 https://localhost:8080/v2/
if [[ "$?" -eq 0 ]]; then echo "TLSv1.0 detected"; exit 1; fi
curl -kv --tls-max 1.1 -0 https://localhost:8080/v2/
if [[ "$?" -eq 0 ]]; then echo "TLSv1.1 detected"; exit 1; fi
curl -kv --tls-max 1.2 -0 https://localhost:8080/v2/
if [[ "$?" -ne 0 ]]; then echo "TLSv1.2 missing"; exit 1; fi
# Check if zot server is running
cat /proc/$(cat zot.PID)/status | grep State || exit 1

# zot server is running: proceed to testing
./test/scripts/tls_scan.sh
4 changes: 2 additions & 2 deletions examples/config-tls.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"port": "8080",
"realm": "zot",
"tls": {
"cert": "../../test/data/server.cert",
"key": "../../test/data/server.key"
"cert": "test/data/server.cert",
"key": "test/data/server.key"
}
},
"log": {
Expand Down
17 changes: 17 additions & 0 deletions test/scripts/tls_scan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -x

curl -kv --tls-max 1.0 https://localhost:8080/v2/
if [[ "$?" -eq 0 ]]; then echo "TLSv1.0 detected"; exit 1; fi

curl -kv --tls-max 1.1 https://localhost:8080/v2/
if [[ "$?" -eq 0 ]]; then echo "TLSv1.1 detected"; exit 1; fi

curl -kv --tls-max 1.2 https://localhost:8080/v2/
if [[ "$?" -ne 0 ]]; then echo "TLSv1.2 missing"; exit 1; fi

curl -kv --tls-max 1.3 https://localhost:8080/v2/
if [[ "$?" -ne 0 ]]; then echo "TLSv1.3 missing"; exit 1; fi

exit 0
Loading