@@ -96,12 +96,16 @@ class Services_Zencoder extends Services_Zencoder_Base
96
96
* @param string $api_version API version
97
97
* @param string $api_host API host
98
98
* @param bool $debug Enable debug mode
99
+ * @param string $ca_path Path to a directory that holds multiple CA certificates
100
+ * @param string $ca_file Path to a file holding one or more certificates to verify the peer with
99
101
*/
100
102
public function __construct (
101
103
$ api_key = NULL ,
102
104
$ api_version = 'v2 ' ,
103
105
$ api_host = 'https://app.zencoder.com ' ,
104
- $ debug = false
106
+ $ debug = false ,
107
+ $ ca_path = NULL ,
108
+ $ ca_file = NULL
105
109
)
106
110
{
107
111
// Check that library dependencies are met
@@ -114,13 +118,18 @@ public function __construct(
114
118
if (!function_exists ('curl_init ' )) {
115
119
throw new Services_Zencoder_Exception ('cURL extension must be enabled. ' );
116
120
}
121
+
117
122
$ this ->version = $ api_version ;
118
- $ this ->http = new Services_Zencoder_Http (
119
- $ api_host ,
120
- array ("curlopts " => array (
121
- CURLOPT_USERAGENT => self ::USER_AGENT
122
- ), "api_key " => $ api_key , "debug " => $ debug )
123
- );
123
+
124
+ $ http_options = array ("api_version " => $ api_key , "debug " => $ debug , "curlopts " => array (CURLOPT_USERAGENT => self ::USER_AGENT ));
125
+ if (isset ($ ca_path )) {
126
+ $ http_options ["curlopts " ][CURLOPT_CAPATH ] = realpath ($ ca_path );
127
+ }
128
+ if (isset ($ ca_file )) {
129
+ $ http_options ["curlopts " ][CURLOPT_CAINFO ] = realpath ($ ca_file );
130
+ }
131
+
132
+ $ this ->http = new Services_Zencoder_Http ($ api_host , $ http_options );
124
133
$ this ->accounts = new Services_Zencoder_Accounts ($ this );
125
134
$ this ->inputs = new Services_Zencoder_Inputs ($ this );
126
135
$ this ->jobs = new Services_Zencoder_Jobs ($ this );
0 commit comments