{"action":"created","issue":{"url":"https://api.github.com/repos/stianeikeland/node-etcd/issues/39","labels_url":"https://api.github.com/repos/stianeikeland/node-etcd/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/stianeikeland/node-etcd/issues/39/comments","events_url":"https://api.github.com/repos/stianeikeland/node-etcd/issues/39/events","html_url":"https://github.com/stianeikeland/node-etcd/issues/39","id":68933083,"number":39,"title":"SSL broken","user":{"login":"psi-4ward","id":1191572,"avatar_url":"https://avatars.githubusercontent.com/u/1191572?v=3","gravatar_id":"","url":"https://api.github.com/users/psi-4ward","html_url":"https://github.com/psi-4ward","followers_url":"https://api.github.com/users/psi-4ward/followers","following_url":"https://api.github.com/users/psi-4ward/following{/other_user}","gists_url":"https://api.github.com/users/psi-4ward/gists{/gist_id}","starred_url":"https://api.github.com/users/psi-4ward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psi-4ward/subscriptions","organizations_url":"https://api.github.com/users/psi-4ward/orgs","repos_url":"https://api.github.com/users/psi-4ward/repos","events_url":"https://api.github.com/users/psi-4ward/events{/privacy}","received_events_url":"https://api.github.com/users/psi-4ward/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-16T14:14:29Z","updated_at":"2015-04-16T20:31:01Z","closed_at":null,"body":"[client.js](https://github.com/stianeikeland/node-etcd/blob/master/src/client.coffee#L96) uses the `request` module which has its own [SSL support](https://github.com/request/request#tlsssl-protocol)\r\n\r\n[Setting up an HttpAgent](https://github.com/stianeikeland/node-etcd/blob/master/src/index.coffee#L240) dont work (anymore)\r\n\r\nProbably it should:\r\n\r\n```coffeescript\r\n    if @sslopts?\r\n      serverprotocol = \"https\"\r\n\r\n    opt = {\r\n      path: \"#{apiVersion}/#{path}\"\r\n      serverprotocol: serverprotocol\r\n      json: true\r\n      agentOptions: #{sslopts}\r\n      qs: queryString\r\n      clientOptions: clientOptions\r\n      synchronous: allOpts.synchronous\r\n      form: { value: value } if value?\r\n    }\r\n```\r\n\r\nsorry for not creating a pull-request but coffee is something to dring ;)"},"comment":{"url":"https://api.github.com/repos/stianeikeland/node-etcd/issues/comments/93832959","html_url":"https://github.com/stianeikeland/node-etcd/issues/39#issuecomment-93832959","issue_url":"https://api.github.com/repos/stianeikeland/node-etcd/issues/39","id":93832959,"user":{"login":"psi-4ward","id":1191572,"avatar_url":"https://avatars.githubusercontent.com/u/1191572?v=3","gravatar_id":"","url":"https://api.github.com/users/psi-4ward","html_url":"https://github.com/psi-4ward","followers_url":"https://api.github.com/users/psi-4ward/followers","following_url":"https://api.github.com/users/psi-4ward/following{/other_user}","gists_url":"https://api.github.com/users/psi-4ward/gists{/gist_id}","starred_url":"https://api.github.com/users/psi-4ward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psi-4ward/subscriptions","organizations_url":"https://api.github.com/users/psi-4ward/orgs","repos_url":"https://api.github.com/users/psi-4ward/repos","events_url":"https://api.github.com/users/psi-4ward/events{/privacy}","received_events_url":"https://api.github.com/users/psi-4ward/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T20:31:01Z","updated_at":"2015-04-16T20:31:01Z","body":"According your `etcdctl` i assume you are using version 2.0 cause 0.4 has no support for the `-cert-file` in `etcdctl`.\r\n\r\nI have 0.4 here (CoreOS). \r\n\r\nThe next thing: Youre using a 1-node-cluster right?\r\nIve several nodes here and in <2.0 you have to \"speak\" to the leader. A request to any follower results in an `Status 307 Location: https://leader_ip ...`. While exploring the problem i wondered why i get the 307 Redirect and the next request fails! So perhaps `request()` respects the httpsAgent the first time but not when contstructing the next requests to follow the redirection?"}}