Skip to content

Commit

Permalink
Switch to the Congress API's HTTPS endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
lobostome committed Mar 21, 2014
1 parent b80ebac commit e903002
Show file tree
Hide file tree
Showing 6 changed files with 3,798 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ examples/config/keys
examples/composer.*
examples/vendor
examples/download
# build/api
build/api
build/code-browser
# build/coverage
build/coverage
build/logs
build/pdepend
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Roadmap

Changelog
---------
**0.7.1**
- Switch to the Congress API's HTTPS endpoint

**0.7.0**
- Add Dependency Injection Container

Expand Down
2 changes: 1 addition & 1 deletion src/FurryBear/FurryBear.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class FurryBear
/**
* The library version.
*/
const VERSION = '0.7.0';
const VERSION = '0.7.1';

/**
* The concrete API provider.
Expand Down
6 changes: 6 additions & 0 deletions src/FurryBear/Http/Adapter/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public function getContent($url)
if (!empty($this->headers)) {
$this->proxy->setOption(CURLOPT_HTTPHEADER, $this->headers);
}

if (parse_url($url, PHP_URL_SCHEME) === 'https') {
$this->proxy->setOption(CURLOPT_SSL_VERIFYHOST, 2);
$this->proxy->setOption(CURLOPT_SSL_VERIFYPEER, 1);
$this->proxy->setOption(CURLOPT_CAINFO, __DIR__ . '/cacert.pem');
}

$content = $this->proxy->execute();

Expand Down
Loading

0 comments on commit e903002

Please sign in to comment.