changeset 1636:2d371452658c

Tests: fixed serving binary OCSP responses on win32.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 24 Dec 2020 19:17:05 +0300
parents 7b80c8e0479a
children da52525f49d1
files ssl_ocsp.t ssl_stapling.t
diffstat 2 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ssl_ocsp.t
+++ b/ssl_ocsp.t
@@ -528,6 +528,8 @@ sub http_daemon {
 			$resp = 'ec-resp';
 		}
 
+		next unless -s "$d/$resp.der";
+
 		# ocsp dummy handler
 
 		select undef, undef, undef, 0.02;
@@ -539,8 +541,14 @@ Content-Type: application/ocsp-response
 
 EOF
 
-		print $client $headers . $t->read_file("$resp.der")
-			if -e "$d/$resp.der";
+		local $/;
+		open my $fh, '<', "$d/$resp.der"
+			or die "Can't open $resp.der: $!";
+		binmode $fh;
+		my $content = <$fh>;
+		close $fh;
+
+		print $client $headers . $content;
 	}
 }
 
--- a/ssl_stapling.t
+++ b/ssl_stapling.t
@@ -399,7 +399,14 @@ Content-Type: application/ocsp-response
 
 EOF
 
-		print $client $headers . $t->read_file("$resp.der");
+		local $/;
+		open my $fh, '<', "$d/$resp.der"
+			or die "Can't open $resp.der: $!";
+		binmode $fh;
+		my $content = <$fh>;
+		close $fh;
+
+		print $client $headers . $content;
 	}
 }