{"action":"created","issue":{"url":"https://api.github.com/repos/LeaseWeb/LswApiCallerBundle/issues/16","labels_url":"https://api.github.com/repos/LeaseWeb/LswApiCallerBundle/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/LeaseWeb/LswApiCallerBundle/issues/16/comments","events_url":"https://api.github.com/repos/LeaseWeb/LswApiCallerBundle/issues/16/events","html_url":"https://github.com/LeaseWeb/LswApiCallerBundle/issues/16","id":57528378,"number":16,"title":"Can't call to HTTPS","user":{"login":"LauLaman","id":8283992,"avatar_url":"https://avatars.githubusercontent.com/u/8283992?v=3","gravatar_id":"","url":"https://api.github.com/users/LauLaman","html_url":"https://github.com/LauLaman","followers_url":"https://api.github.com/users/LauLaman/followers","following_url":"https://api.github.com/users/LauLaman/following{/other_user}","gists_url":"https://api.github.com/users/LauLaman/gists{/gist_id}","starred_url":"https://api.github.com/users/LauLaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LauLaman/subscriptions","organizations_url":"https://api.github.com/users/LauLaman/orgs","repos_url":"https://api.github.com/users/LauLaman/repos","events_url":"https://api.github.com/users/LauLaman/events{/privacy}","received_events_url":"https://api.github.com/users/LauLaman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-12T22:17:49Z","updated_at":"2015-08-13T17:26:51Z","closed_at":null,"body":"HTTPS://api.lifx.com:443/v1beta1/lights.json and https://api.lifx.com/v1beta1/lights.json wont work\r\nno request will be send. (Connection failed)\r\n![image](https://cloud.githubusercontent.com/assets/8283992/6178232/3b3b86a2-b30d-11e4-9c03-e281e75f255c.png)\r\n\r\nHTTP://api.lifx.com:443/v1beta1/lights.json returns 400 Bad Request (which is good)\r\n![image](https://cloud.githubusercontent.com/assets/8283992/6178243/4d7ff41a-b30d-11e4-849b-0f8b7cbded54.png)\r\n\r\n\r\ncontroller\r\n```php\r\n        $url = \"https://api.lifx.com:443/v1beta1/lights.json\";\r\n        $result = $this->get('api_caller')->call(new HttpGetJson($url, array()));\r\n```\r\n\r\nHttpGetJson\r\n```php\r\nclass HttpGetJson extends CurlCall implements ApiCallInterface\r\n{\r\n    /**\r\n    * {@inheritdoc}\r\n    */\r\n    public function generateRequestData()\r\n    {\r\n        $this->requestData = http_build_query($this->requestObject);\r\n    }\r\n\r\n    /**\r\n     * {@inheritdoc}\r\n     */\r\n    public function parseResponseData()\r\n    {\r\n        $this->responseObject = json_decode($this->responseData, $this->asAssociativeArray);\r\n    }\r\n\r\n    /**\r\n     * {@inheritdoc}\r\n     */\r\n    public function makeRequest($curl, $options)\r\n    {\r\n        $curl->setopt(CURLOPT_URL, $this->url.'?'.$this->requestData);\r\n        $curl->setopt(CURLOPT_HTTPHEADER, array('Content-type: application/json'));\r\n        $curl->setoptArray($options);\r\n        $this->responseData = $curl->exec();\r\n    }\r\n\r\n}\r\n```\r\n\r\nWhen i use the direct way it will work just fine (returns a 401 error cause we're not sending our api key along)\r\n```php\r\n        $ch = curl_init();\r\n        curl_setopt($ch, CURLOPT_URL, 'https://api.lifx.com:443/v1beta1/lights.json');\r\n        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));\r\n        curl_setopt($ch, CURLOPT_GET, 1);\r\n        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\r\n        $result = curl_exec($ch);\r\n```"},"comment":{"url":"https://api.github.com/repos/LeaseWeb/LswApiCallerBundle/issues/comments/130770514","html_url":"https://github.com/LeaseWeb/LswApiCallerBundle/issues/16#issuecomment-130770514","issue_url":"https://api.github.com/repos/LeaseWeb/LswApiCallerBundle/issues/16","id":130770514,"user":{"login":"iisisrael","id":932987,"avatar_url":"https://avatars.githubusercontent.com/u/932987?v=3","gravatar_id":"","url":"https://api.github.com/users/iisisrael","html_url":"https://github.com/iisisrael","followers_url":"https://api.github.com/users/iisisrael/followers","following_url":"https://api.github.com/users/iisisrael/following{/other_user}","gists_url":"https://api.github.com/users/iisisrael/gists{/gist_id}","starred_url":"https://api.github.com/users/iisisrael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iisisrael/subscriptions","organizations_url":"https://api.github.com/users/iisisrael/orgs","repos_url":"https://api.github.com/users/iisisrael/repos","events_url":"https://api.github.com/users/iisisrael/events{/privacy}","received_events_url":"https://api.github.com/users/iisisrael/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T17:26:51Z","updated_at":"2015-08-13T17:26:51Z","body":"I ran into this same issue sending a request to my development server, which just has the snakeoil cert.  You have to also set the CURLOPT_SSL_VERIFYHOST to false.  Update your config.yml like so:\r\n```\r\nparameters:\r\n    api_caller.options:\r\n        ...\r\n        ssl_verifypeer: false # to stop cURL from verifying the peer's certificate.\r\n        ssl_verifyhost: false\r\n```\r\n\r\nTo expand on @mevdschee's comment, you can capture the curl logging info with the method from his link by temporarily changing ```HttpGetJson::makeRequest()``` like so (using Symfony's ```debug``` method):\r\n```\r\n        $curl->setopt(CURLOPT_URL, $this->url.'?'.$this->requestData);\r\n\r\n        // set up debug\r\n        $options[CURLOPT_VERBOSE] = true;\r\n        $verbose = fopen('php://temp', 'w+');\r\n        $options[CURLOPT_STDERR] = $verbose;\r\n\r\n        $curl->setoptArray($options);\r\n        $this->responseData = $curl->exec();\r\n\r\n        // dump debug\r\n        rewind($verbose);\r\n        dump(stream_get_contents($verbose));\r\n```\r\nor just log to a file like so:\r\n```\r\n        $curl->setopt(CURLOPT_URL, $this->url.'?'.$this->requestData);\r\n\r\n        // set up debug\r\n        $options[CURLOPT_VERBOSE] = true;\r\n        $verbose = fopen('/home/path/to/myfile.log', 'w+');\r\n        $options[CURLOPT_STDERR] = $verbose;\r\n\r\n        $curl->setoptArray($options);\r\n        $this->responseData = $curl->exec();\r\n```"}}