Skip to content

Commit e4693cb

Browse files
committed
Support for self signed certificate
1 parent e1b6480 commit e4693cb

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
],
1515
"require": {
1616
"php": ">=5.6.0",
17-
"illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0",
18-
"simplepie/simplepie": "^1.5"
17+
"illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0",
18+
"simplepie/simplepie": "^1.5",
19+
"ext-curl": "*"
1920
},
2021
"require-dev": {
2122
"phpunit/phpunit": "^8.4",

config/feed-reader.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@
5959
* @var boolean
6060
*/
6161
'order-by-date' => false,
62+
63+
/**
64+
* Whether it should verify SSL, set false to make it work with self-signed certificates
65+
*
66+
* @var boolean
67+
*/
68+
'ssl-verify' => true,
6269
],
6370
],
6471
];

src/FeedReader.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ public function read($url, $configuration = 'default')
5555
// Should we be ordering the feed by date?
5656
$sp->enable_order_by_date($this->readConfig($configuration, 'order-by-date', false));
5757

58+
if (! $this->readConfig($configuration, 'ssl-verify', true)) {
59+
$sp->set_curl_options([
60+
CURLOPT_SSL_VERIFYHOST => false,
61+
CURLOPT_SSL_VERIFYPEER => false,
62+
]);
63+
}
64+
5865
// Set the feed URL
5966
$sp->set_feed_url($url);
6067

0 commit comments

Comments
 (0)