File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ ANY_CA_PEM=integration-tests/one-existing-ca.pem
6
6
ANY_CA_SUBJECT=" OU=GlobalSign Root CA - R3, O=GlobalSign, CN=GlobalSign"
7
7
8
8
reset () {
9
- security remove-trusted-cert -d $ANY_CA_PEM || true
10
- list | grep " $ANY_CA_SUBJECT "
9
+ printf " \n*** Remove test CA ***\n"
10
+ CERT_HASH=$( openssl x509 -in $ANY_CA_PEM -noout -fingerprint -sha1 | cut -d= -f2 | tr -d :)
11
+ security delete-certificate -Z " $CERT_HASH " /Library/Keychains/System.keychain || true
12
+ list | grep " $ANY_CA_SUBJECT " || true
11
13
}
12
14
13
15
list () {
@@ -28,12 +30,14 @@ assert_exists() {
28
30
29
31
test_distrust_existing_root () {
30
32
assert_exists " $ANY_CA_SUBJECT "
33
+ printf " \n*** Add test CA ***\n"
31
34
security add-trusted-cert -d -r deny $ANY_CA_PEM
32
35
assert_missing " $ANY_CA_SUBJECT "
33
36
reset
34
37
}
35
38
36
39
# https://developer.apple.com/forums/thread/671582?answerId=693632022#693632022
40
+ printf " \n*** Enable trust settings ***\n"
37
41
security authorizationdb write com.apple.trust-settings.admin allow
38
42
39
43
reset
You can’t perform that action at this time.
0 commit comments