[master] dfcb080 Improved vtc test for vmod_proxy

Geoff Simmons geoff at uplex.de
Mon Apr 2 15:24:10 UTC 2018


commit dfcb080d3a514324f314fa325e4b46152861a230
Author: Emmanuel Hocdet <manu at gandi.net>
Date:   Thu Mar 15 15:15:16 2018 +0100

    Improved vtc test for vmod_proxy

diff --git a/bin/varnishtest/tests/o00005.vtc b/bin/varnishtest/tests/o00005.vtc
index 49cb0ef..d40e353 100644
--- a/bin/varnishtest/tests/o00005.vtc
+++ b/bin/varnishtest/tests/o00005.vtc
@@ -9,18 +9,30 @@ varnish v1 -proto "PROXY" -vcl+backend {
 	import proxy;
 
 	sub vcl_deliver {
+	    if (proxy.is_ssl()) {
+	       set resp.http.is_ssl = "yes";
+	    }
+	    if (!proxy.client_has_cert_sess()) {
+	       set resp.http.client_has_cert_sess = "no";
+	    }
+	    if (!proxy.client_has_cert_conn()) {
+	       set resp.http.client_has_cert_conn = "no";
+	    }
 	    if (proxy.ssl_verify_result() == 0) {
 	       set resp.http.verify = "ok";
 	    }
 	    set resp.http.alpn = proxy.alpn();
+	    set resp.http.authority = proxy.authority();
 	    set resp.http.ssl-version = proxy.ssl_version();
 	    set resp.http.cipher = proxy.ssl_cipher();
 	    set resp.http.key = proxy.cert_key();
 	    set resp.http.sign = proxy.cert_sign();
+	    set resp.http.cn = proxy.client_cert_cn();
 	}
 } -start
 
 client c1 {
+	# PROXY2 with CRC32C TLV
 	sendhex "0d 0a 0d 0a 00 0d 0a 51 55 49 54 0a 21 11 00 65"
 	sendhex "d9 46 b5 21 5f 8e a8 22 ed 96 01 bb 03 00 04 95"
 	sendhex "03 ee 75 01 00 02 68 32 02 00 0a 68 6f 63 64 65"
@@ -32,10 +44,29 @@ client c1 {
 	txreq
 	rxresp
 	expect resp.status == 200
+	expect resp.http.is_ssl == yes
+	expect resp.http.client_has_cert_sess == no
+	expect resp.http.client_has_cert_conn == no
 	expect resp.http.verify == ok
 	expect resp.http.alpn == h2
+	expect resp.http.authority == hocdet.net
 	expect resp.http.ssl-version == TLSv1.3
 	expect resp.http.cipher == AEAD-AES128-GCM-SHA256
 	expect resp.http.key == EC256
 	expect resp.http.sign == RSA-SHA256
+	expect resp.http.cn == ""
+} -run
+
+client c1 {
+	# PROXY2 with CRC32C TLV and bad checksum
+	sendhex "0d 0a 0d 0a 00 0d 0a 51 55 49 54 0a 21 11 00 65"
+	sendhex "d9 46 b5 21 5f 8e a8 22 ed 96 01 bb 03 00 04 95"
+	sendhex "03 ee 75 01 00 02 68 32 02 00 0a 68 6f 63 64 65"
+	sendhex "74 2e 6e 65 74 20 00 3d 01 00 00 00 00 21 00 07"
+	sendhex "54 4c 53 76 31 2e 33 25 00 05 45 43 32 35 36 24"
+	sendhex "00 0a 52 53 41 2d 53 48 41 32 35 36 23 00 16 41"
+	sendhex "45 41 44 2d 41 45 53 31 32 38 2d 47 43 4d 2d 53"
+	sendhex "48 41 32 35 35"
+	txreq
+	expect_close
 } -run


More information about the varnish-commit mailing list