Skip to content

Commit e419417

Browse files
committed
tests: generalize update_valid_1_cert.bash
1. Rename to `update_valid_ee_certs.bash` 2. Don't hardcode location of `bash` for shebang. 3. Remove echo's about potential future extensions. 4. Add a helper function for fetching EE certs. 5. Use helper to update all three valid realworld testcase EE certs instead of just `1password_com_valid_1.crt`
1 parent 57a2d16 commit e419417

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

src/tests/verification_real_world/update_valid_1_cert.bash

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
6+
7+
fetch_ee_cert() {
8+
local domain="$1"
9+
local out_file="$2"
10+
11+
echo -n |
12+
openssl s_client \
13+
-connect "$domain:443" \
14+
-servername "$domain" |
15+
openssl x509 \
16+
-outform DER > "$DIR/$out_file"
17+
}
18+
19+
fetch_ee_cert "my.1password.com" "1password_com_valid_1.crt"
20+
fetch_ee_cert "agilebits.com" "agilebits_com_valid_1.crt"
21+
fetch_ee_cert "lencr.org" "letsencrypt_org_valid_1.crt"

0 commit comments

Comments
 (0)