You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-commits@perl.apache.org by rj...@apache.org on 2018/10/20 07:48:03 UTC

svn commit: r1844396 - /perl/Apache-Test/trunk/lib/Apache/TestRequest.pm

Author: rjung
Date: Sat Oct 20 07:48:03 2018
New Revision: 1844396

URL: http://svn.apache.org/viewvc?rev=1844396&view=rev
Log:
Allow to set CA file for raw TLS socket.

Old Net::SSL did not verify peer certs by
default, IO::Socket::SSL does verify them
by default.

Modified:
    perl/Apache-Test/trunk/lib/Apache/TestRequest.pm

Modified: perl/Apache-Test/trunk/lib/Apache/TestRequest.pm
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/lib/Apache/TestRequest.pm?rev=1844396&r1=1844395&r2=1844396&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestRequest.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestRequest.pm Sat Oct 20 07:48:03 2018
@@ -656,6 +656,15 @@ sub set_client_cert {
     }
 }
 
+# Only for IO::Socket:SSL raw socket compatibility,
+# when using user_agent() already done in its
+# constructor.
+sub set_ca_cert {
+    my $vars = Apache::Test::vars();
+    my $cafile = "$vars->{sslca}/$vars->{sslcaorg}/certs/ca.crt";
+    $conn_opts->{SSL_ca_file} = $cafile;
+}
+
 #want news: urls to work with the LWP shortcuts
 #but cant find a clean way to override the default nntp port
 #by brute force we trick Net::NTTP into calling FixupNNTP::new