Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Puma MiniSSL Filehandle Leak #2299

Closed
JohnPhillips31416 opened this issue Jun 26, 2020 · 4 comments
Closed

Puma MiniSSL Filehandle Leak #2299

JohnPhillips31416 opened this issue Jun 26, 2020 · 4 comments

Comments

@JohnPhillips31416
Copy link
Contributor

Describe the bug
When running with JRuby and configured with a Puma::MiniSSL::Context with a keystore file path MiniSSL will open 2 filehandles to the keystore file on every SSL REST request. These filehandles do not get closed until a subsequent Java garbage collection occurs.

Expected behavior
Ideally MiniSSL should only open/read the keystore file once, not on each https request. A simpler fix is just to properly close the 2 FileInputStream objects after use.

ks.load(new FileInputStream(keystoreFile), password);

ts.load(new FileInputStream(keystoreFile), password);

Desktop (please complete the following information):

  • OS: Linux
  • Puma Version 4.3.5
@nateberkopec
Copy link
Member

Nice catch. Want to open a PR with your change?

@JohnPhillips31416
Copy link
Contributor Author

I'll do this when I have time, we should probably refactor so the keystore is only read from disk once.

@JohnPhillips31416
Copy link
Contributor Author

fix is here #2302

@MSP-Greg
Copy link
Member

Closed by #2302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants