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

Don't null out the SSL relay nuke directory, otherwise we'll never cleanup the SSL support files. #109

Closed
wants to merge 1 commit into from

Conversation

nirvdrum
Copy link
Contributor

Fixes #108: SSL support directories not being cleaned up.

@lightbody if you could take a look at this, it'd be much appreciated. It looks like you explicitly nulled out this directory in a commit about a year ago. I couldn't garner from context why though.

…ean up the SSL support files.

Fixes webmetrics#108: SSL support directories not being cleaned up.
@lightbody
Copy link
Member

This was done to make sure that we could re-establish a connection to that that SSL host very quickly for long-running proxies. So we need to leave the files around until at least when the JVM (or BMP service) is terminated. So your change is not right either, since it'll lose the fast caching.

Can you work on a change that won't delete the files when the SocketListener is closed, but will when the proxy itself is terminate or the JVM dies? I had hoped that because we use File.createTempFile this would happen automatically but it doesn't :(

@nirvdrum
Copy link
Contributor Author

I thought that might be why it was done, but when I close the proxy and re-open it, a new set of SSL support files is created anyway. Any idea why that might be the case?

@nirvdrum
Copy link
Contributor Author

My analysis may be wrong here, but when a proxy is created, a new BrowserMobProxyHandler is created. This new instance always has a blank SSL map and SSL support directory is created as a temp directory, meaning it has random characters in the directory name. As a result of the blank map, a new set of support files is created. As a result of them being temp directories with random chars, they're always written to different locations. So, I don't see how these files can be used across proxies. Perhaps that's a separate bug?

@lightbody
Copy link
Member

You're right: they aren't used across proxies, but they should be!

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

Successfully merging this pull request may close these issues.

SSL support directories not being cleaned up
2 participants