Skip to content

Commit

Permalink
added configuration ability to specify alternate CA cert information
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip Shipley committed Oct 24, 2013
1 parent d48eb9f commit ad24733
Show file tree
Hide file tree
Showing 20 changed files with 988 additions and 256 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ include_once './vendor/autoload.php';
## API Documentation ##
API documentation generated from phpDocs by apigen is available in the docs/ folder.

## Using a Proxy ##
You can configure the library to use a proxy if needed for debugging or otherwise. I've used it with [Charles Proxy]() many times to debug my calls and responses from ApiAxle. To configure it to use a proxy, simply set these attributes in the configuration:
```php
'proxy_enable' => true,
'proxy_host' => '127.0.0.1',
'proxy_port' => '8888',
```

## Using your own CA Certs ##
If you are running in an environment where you have your own CA and want to validate the certs, you can configure this library to specify where to find the CA info or a path to a folder with certs. This uses the curl_setopt features in PHP to set these. In order for them to work though, the ssl_verifypeer setting needs to be ```true```:
```php
'ssl_verifypeer' => true,
'ssl_cainfo' => null,
'ssl_capath' => '/etc/pki/tls/certs/',
```

## Contributing ##
If you are interested in contributing to this library and/or extending it please let me know, I'd love to work with others on this to help consider other use cases and design patterns.

Expand Down
2 changes: 2 additions & 0 deletions config/config.local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ return array(
'key' => 'somerandomstring',
'secret' => 'somelongerrandomstring',
'ssl_verifypeer' => true,
'ssl_cainfo' => null,
'ssl_capath' => null,
'proxy_enable' => false,
'proxy_host' => '127.0.0.1',
'proxy_port' => '8888',
Expand Down
2 changes: 2 additions & 0 deletions config/config.travis.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
'key' => 'apiaxle-travis-ci-key',
'secret' => 'apiaxle-travis-ci-secret',
'ssl_verifypeer' => true,
'ssl_cainfo' => null,
'ssl_capath' => null,
'proxy_enable' => false,
'proxy_host' => '127.0.0.1',
'proxy_port' => '8888',
Expand Down
2 changes: 1 addition & 1 deletion docs/class-ApiAxle.Api.Api.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h1>Class Api</h1>

<b>Author:</b>
Phillip Shipley &lt;<a
href="mailto:phillip&#64;phillipshipley.com">phillip&#64;<!---->phillipshipley.com</a>&gt;<br />
href="mailto:phillip&#64;phillipshipley.com">phillip&#64;<!-- -->phillipshipley.com</a>&gt;<br />
<b>Located at</b> <a href="source-class-ApiAxle.Api.Api.html#15-576" title="Go to source code">src/ApiAxle/Api/Api.php</a><br />
</div>

Expand Down
2 changes: 1 addition & 1 deletion docs/class-ApiAxle.Api.Key.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h1>Class Key</h1>

<b>Author:</b>
Phillip Shipley &lt;<a
href="mailto:phillip&#64;phillipshipley.com">phillip&#64;<!---->phillipshipley.com</a>&gt;<br />
href="mailto:phillip&#64;phillipshipley.com">phillip&#64;<!-- -->phillipshipley.com</a>&gt;<br />
<b>Located at</b> <a href="source-class-ApiAxle.Api.Key.html#14-482" title="Go to source code">src/ApiAxle/Api/Key.php</a><br />
</div>

Expand Down
2 changes: 1 addition & 1 deletion docs/class-ApiAxle.Api.Keyring.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h1>Class Keyring</h1>

<b>Author:</b>
Phillip Shipley &lt;<a
href="mailto:phillip&#64;phillipshipley.com">phillip&#64;<!---->phillipshipley.com</a>&gt;<br />
href="mailto:phillip&#64;phillipshipley.com">phillip&#64;<!-- -->phillipshipley.com</a>&gt;<br />
<b>Located at</b> <a href="source-class-ApiAxle.Api.Keyring.html#14-408" title="Go to source code">src/ApiAxle/Api/Keyring.php</a><br />
</div>

Expand Down
Loading

0 comments on commit ad24733

Please sign in to comment.