Skip to content

Commit

Permalink
PSL: updated download script and PSL itself
Browse files Browse the repository at this point in the history
  • Loading branch information
sad-spirit committed Feb 13, 2016
1 parent 7ff7f51 commit 63bf5bb
Show file tree
Hide file tree
Showing 2 changed files with 2,028 additions and 389 deletions.
11 changes: 9 additions & 2 deletions data/generate-list.php
Expand Up @@ -4,10 +4,13 @@
*
* You can run this script to update PSL to the current version instead of
* waiting for a new release of HTTP_Request2.
*
* NB: peer validation is DISABLED when downloading. If you want to enable it,
* change ssl_verify_peer to true and provide CA file (see below)
*/

/** URL to download Public Suffix List from */
define('LIST_URL', 'http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1');
define('LIST_URL', 'https://publicsuffix.org/list/public_suffix_list.dat');
/** Name of PHP file to write */
define('OUTPUT_FILE', dirname(__FILE__) . '/public-suffix-list.php');

Expand Down Expand Up @@ -53,7 +56,11 @@ function writeNode($fp, $valueTree, $key = null, $indent = 0)


try {
$request = new HTTP_Request2(LIST_URL);
$request = new HTTP_Request2(LIST_URL, HTTP_Request2::METHOD_GET, array(
// Provide path to your CA file and change 'ssl_verify_peer' to true to enable peer validation
// 'ssl_cafile' => '... path to your Certificate Authority file ...',
'ssl_verify_peer' => false
));
$response = $request->send();
if (200 != $response->getStatus()) {
throw new Exception("List download URL returned status: " .
Expand Down

0 comments on commit 63bf5bb

Please sign in to comment.