You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo n | docker exec -i client pki -U https://pki.example.com:8443 info \
134
+
> >(tee stdout) 2> >(tee stderr >&2) || true
135
+
136
+
# check stdout
137
+
cat > expected << EOF
138
+
Server URL: https://pki.example.com:8443
139
+
EOF
140
+
141
+
diff expected stdout
142
+
143
+
# check stderr
144
+
cat > expected << EOF
145
+
WARNING: UNTRUSTED ISSUER encountered on 'CN=pki.example.com,OU=pki-tomcat,O=EXAMPLE' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=pki-tomcat,O=EXAMPLE'
146
+
Trust this certificate (y/N)? SEVERE: FATAL: SSL alert sent: BAD_CERTIFICATE
147
+
IOException: Unable to write to socket: Failed to write to socket: (-5987) Invalid function argument.
148
+
EOF
149
+
150
+
diff expected stderr
151
+
152
+
# the cert should not be stored
153
+
docker exec client pki nss-cert-find | tee output
154
+
155
+
diff /dev/null output
156
+
157
+
- name: Check client with untrusted server cert with wrong hostname
158
+
run: |
159
+
# run client with wrong hostname
160
+
echo n | docker exec -i client pki -U https://server.example.com:8443 info \
161
+
> >(tee stdout) 2> >(tee stderr >&2) || true
162
+
163
+
# check stdout
164
+
cat > expected << EOF
165
+
Server URL: https://server.example.com:8443
166
+
EOF
167
+
168
+
diff expected stdout
169
+
170
+
# check stderr
171
+
cat > expected << EOF
172
+
WARNING: BAD_CERT_DOMAIN encountered on 'CN=pki.example.com,OU=pki-tomcat,O=EXAMPLE' indicates a common-name mismatch
173
+
WARNING: UNTRUSTED ISSUER encountered on 'CN=pki.example.com,OU=pki-tomcat,O=EXAMPLE' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=pki-tomcat,O=EXAMPLE'
174
+
Trust this certificate (y/N)? SEVERE: FATAL: SSL alert sent: BAD_CERTIFICATE
175
+
IOException: Unable to write to socket: Failed to write to socket: (-12276) Unable to communicate securely with peer: requested domain name does not match the server's certificate.
176
+
EOF
177
+
178
+
diff expected stderr
179
+
180
+
- name: Check client with newly trusted server cert
181
+
run: |
182
+
# run client and trust the cert
183
+
echo y | docker exec -i client pki -U https://pki.example.com:8443 info \
184
+
> >(tee stdout) 2> >(tee stderr >&2) || true
185
+
186
+
# check stdout
187
+
cat > expected << EOF
188
+
Server URL: https://pki.example.com:8443
189
+
Server Name: Dogtag Certificate System
190
+
Server Version: 11.6.0
191
+
EOF
192
+
193
+
diff expected stdout
194
+
195
+
# check stderr
196
+
cat > expected << EOF
197
+
WARNING: UNTRUSTED ISSUER encountered on 'CN=pki.example.com,OU=pki-tomcat,O=EXAMPLE' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=pki-tomcat,O=EXAMPLE'
0 commit comments