bolinfest / plovr

plovr: a Closure build tool
78 stars 48 forks source link

https serving doesn't work #135

Closed theRobinator closed 7 years ago

theRobinator commented 7 years ago

Building from the latest master, it looks like the --https option doesn't work. My company actually has some code sitting around from 2013 that patched the old version of plovr using the bouncycastle library. I can bring that up to speed with the current version and submit that in a PR if you like.

Repro follows:

plovr.json

{
  "id": "app",
  "level": "VERBOSE",
  "mode": "RAW",
  "inputs": ["input.js"]
}

input.js

console.log('hello world!');

Console output

Robin$ java -jar plovr.jar serve --https plovr.json &
[1] 3989
Listening on /0:0:0:0:0:0:0:0:9810
Robin$ 
Robin$ curl https://localhost:9810
Jun 06, 2017 3:30:58 PM sun.net.httpserver.ServerImpl$Exchange run
WARNING: SSL connection received. No https contxt created
curl: (35) Unknown SSL protocol error in connection to localhost:9810
nicks commented 7 years ago

sure, we'd accept a patch for this.

It also might make more sense to remove this flag -- I think the modern way to do this is to run an https->http reverse proxy as a separate service, which makes it a bit easier to manage the certs in one place.

theRobinator commented 7 years ago

OK so I spent a few hours porting my company's fix over and realized that we're doing a seemingly-shady hack to unsign the bouncycastle lib before packaging it in with plovr. Having not used Buck before, I haven't been able to replicate the hack in the plovr build, and given the shadiness I'm not sure we'd want to anyway.

So like Nick suggested, I'm going to go with a reverse proxy solution. If anybody finds this thread and is better at Java builds than I am, I'm happy to provide my patch to the code.