Skip to content

Commit

Permalink
Fix for 'package download' failing with proxy
Browse files Browse the repository at this point in the history
The call to requestProgess which handles the actual file download is missing the proxy parameter that allows it to work from behind proxies. This PR adds the parameter. It has been tested in my proxy environment and resolves the problem.

Error received before fix:
16:12:47 + ionic package download 5
16:12:49 
16:12:49 Error: tunneling socket could not be established, cause=write EPROTO 140355477145408:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:794:
16:12:49 
16:12:49     at ClientRequest.onError (/var/lib/jenkins/.nvm/versions/node/v4.4.3/lib/node_modules/ionic/node_modules/tunnel-agent/index.js:176:17)
16:12:49     at ClientRequest.g (events.js:260:16)
16:12:49     at emitOne (events.js:77:13)
16:12:49     at ClientRequest.emit (events.js:169:7)
16:12:49     at TLSSocket.socketErrorListener (_http_client.js:256:9)
16:12:49     at emitOne (events.js:77:13)
16:12:49     at TLSSocket.emit (events.js:169:7)
16:12:49     at onwriteError (_stream_writable.js:313:10)
16:12:49     at onwrite (_stream_writable.js:331:5)
16:12:49     at WritableState.onwrite (_stream_writable.js:89:5)
16:12:49 
16:12:49 tunneling socket could not be established, cause=write EPROTO 140355477145408:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:794:
16:12:49  (CLI v1.7.14)
  • Loading branch information
errant01 committed May 6, 2016
1 parent 08c4ef4 commit 40c6cfd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ Package.downloadBuild = function(appId, jar, buildId, downloadDir) {
filename = build.name + '.' + Package.determineFileExtensionByPlatform(build.platform);
filepath = path.join(downloadDir, filename);

requestProgess(request({ url: build.url }))
var reqParams = {
url: build.url,
proxy: process.env.PROXY || process.env.http_proxy || null
}

requestProgess(request(reqParams))
.on('progress', function(state) {
q.notify(state);
})
Expand Down

0 comments on commit 40c6cfd

Please sign in to comment.