From: William Lallemand Date: Thu, 28 Jan 2021 13:59:19 +0000 (+0100) Subject: REGTESTS: set_ssl_server_cert.vtc: check the Sha1 Fingerprint X-Git-Tag: v2.4-dev7~118 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e69637ac5a2ed50b97efa67834f0697d3f7c496;p=thirdparty%2Fhaproxy.git REGTESTS: set_ssl_server_cert.vtc: check the Sha1 Fingerprint Check the sha1 fingerprint once the certificate was changed with "show ssl cert". This way the test is more reliable. --- diff --git a/reg-tests/ssl/set_ssl_server_cert.vtc b/reg-tests/ssl/set_ssl_server_cert.vtc index a16ea80bbd..391a29b948 100644 --- a/reg-tests/ssl/set_ssl_server_cert.vtc +++ b/reg-tests/ssl/set_ssl_server_cert.vtc @@ -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