]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: set_ssl_server_cert.vtc: check the Sha1 Fingerprint
authorWilliam Lallemand <wlallemand@haproxy.org>
Thu, 28 Jan 2021 13:59:19 +0000 (14:59 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Thu, 28 Jan 2021 14:11:59 +0000 (15:11 +0100)
Check the sha1 fingerprint once the certificate was changed with "show
ssl cert". This way the test is more reliable.

reg-tests/ssl/set_ssl_server_cert.vtc

index a16ea80bbd798f70c3718a71722c8ecbb76c0485..391a29b94875c492dbfa5349d91d2d28addd5e3d 100644 (file)
@@ -59,12 +59,23 @@ client c1 -connect ${h1_clearlst_sock} {
   expect resp.http.x-ssl == "Ok"
 } -run
 
+haproxy h1 -cli {
+    send "show ssl cert ${testdir}/client1.pem"
+    expect ~ ".*SHA1 FingerPrint: D9C3BAE37EA5A7EDB7B3C9BDD4DCB2FE58A412E4"
+}
+
 # Replace certificate with an expired one
 shell {
     printf "set ssl cert ${testdir}/client1.pem <<\n$(cat ${testdir}/client2_expired.pem)\n\n" | socat "${tmpdir}/h1/stats" -
     echo "commit ssl cert ${testdir}/client1.pem" | socat "${tmpdir}/h1/stats" -
 }
 
+haproxy h1 -cli {
+    send "show ssl cert ${testdir}/client1.pem"
+    expect ~ ".*SHA1 FingerPrint: C625EB01A0A660294B9D7F44C5CEEE5AFC495BE4"
+}
+
+
 # The updated client certificate is an expired one so this request should fail
 client c1 -connect ${h1_clearlst_sock} {
     txreq
@@ -79,6 +90,11 @@ shell {
     echo "commit ssl cert ${testdir}/client1.pem" | socat "${tmpdir}/h1/stats" -
 }
 
+haproxy h1 -cli {
+    send "show ssl cert ${testdir}/client1.pem"
+    expect ~ ".*SHA1 FingerPrint: 992386628A40C9D49C89BAC0058B5D45D8575151"
+}
+
 # The updated client certificate is a revoked one so this request should fail
 client c1 -connect ${h1_clearlst_sock} {
     txreq