Original version
authorJ. Hendrix <gitweb@localhost>
Sun, 31 Jan 2016 17:30:45 +0000 (18:30 +0100)
committerJ. Hendrix <gitweb@localhost>
Sun, 31 Jan 2016 17:30:45 +0000 (18:30 +0100)
perlHttps [new file with mode: 0755]

diff --git a/perlHttps b/perlHttps
new file mode 100755 (executable)
index 0000000..5d22d42
--- /dev/null
+++ b/perlHttps
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use LWP;
+
+my $url = 'https://www.hackinfo.nl/index.php?format=feed&type=rss';
+my $useragent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0';
+
+my $can_accept = HTTP::Message::decodable;
+
+my $browser = LWP::UserAgent->new();
+$browser->agent( $useragent );
+$browser->ssl_opts( verify_hostname => 1 );
+
+# This uses system repositories, automatically updated from repositories.
+#$browser->ssl_opts( SSL_ca_path => "/etc/ssl/certs/" );
+
+# This uses Mozilla::CA. Not automatically updated!
+# Download and untar: http://search.cpan.org/CPAN/authors/id/A/AB/ABH/Mozilla-CA-20160104.tar.gz
+$browser->ssl_opts( SSL_ca_file => "./Mozilla-CA-20160104/lib/Mozilla/CA/cacert.pem" );
+
+my $response = $browser->get( "$url" , 'Accept-Encoding' => $can_accept );
+if ( ! $response->is_success ) { warn "Can't get $url -- ", $response->status_line; }
+print $response->decoded_content( charset => 'none' );