Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Betamax tests - #21

Closed
cowboygneox wants to merge 11 commits into
twingly:masterfrom
cowboygneox:betamaxTests
Closed

cowboygneox wants to merge 11 commits into
twingly:masterfrom
cowboygneox:betamaxTests

Conversation

@cowboygneox

Copy link
Copy Markdown

Attempting to fix the issues with the PR #18. Let's see if this works

xSAVIKx and others added 6 commits March 12, 2016 12:04
added betamax functional tests
rewrite UrlConnectionClientFunctionTest with groovy and Spock
ensure that VERSION constant is always initialized after version property is gathered from version.properties.
betamax-snapshot should be used until new stable release won't be presented.
add betamax-generated SSL certificated to gitignore
@walro

walro commented May 31, 2016

Copy link
Copy Markdown
Contributor

@cowboygneox any news? :)

@cowboygneox

Copy link
Copy Markdown
Author

@walro I know it's been on and off for me, but every time I'm on, I'm making progress. I'm in-between contracts now, so once I catch up a little bit more, I should have plenty of time to get on top of Betamax.

@walro

walro commented May 31, 2016

Copy link
Copy Markdown
Contributor

Alright, thanks for getting back to me (us)!

@cowboygneox

Copy link
Copy Markdown
Author

@walro This is what I'm working on today. I'll report anything I learn as I go.

@cowboygneox

Copy link
Copy Markdown
Author

After some digging, I'm seeing a SecureRandom likely due to the Docker image. I'm not sure how to fix it yet, but I have some experience fighting this issue. Let's see what I can do.

@cowboygneox

Copy link
Copy Markdown
Author

I'm quite convinced it's a SecureRandom issue, but I'm not sure what to do about it yet.

@cowboygneox

Copy link
Copy Markdown
Author

@walro So when I ran without docker, it passed on the Oracle JVM's. I'm not sure why the OpenJDK crashed, but it could be a fluke. I'm going to continue to try and figure out what Docker does to make this not work.

@walro

walro commented Jun 1, 2016

Copy link
Copy Markdown
Contributor

Awesome, thanks for the update!

We had troubles with OpenJDK7 in the very first Travis test run, but we just switched over to contained-based builds and never looked back :)

@cowboygneox

Copy link
Copy Markdown
Author

@walro I'm a huge supporter of Docker, but I'm sure this issue comes down to entropy for the random. Even providing a -D to change the random loader still doesn't fix the issue. The JVM must not obey that in all places (probably for good reason when it comes to SSL). I'm still working on it.

@cowboygneox

Copy link
Copy Markdown
Author

@walro I emailed Travis asking if there's something they recommend for increasing entropy on the Docker containers. For today, I've done all I can, but I'll keep on top of it.

I will be sure to document this issue and solution in length when we finally get to the end of it.

@cowboygneox

cowboygneox commented Jun 3, 2016 •

Copy link
Copy Markdown
Author

@walro Ok, TravisCI and I have confirmed that it's not a /dev/random issue, which leaves only one alternative: I have to completely change how we're doing MITM proxies. What I'll likely do (but I need to give it some thought) is ask users of Betamax to install a Betamax certificate as a CA into their CI's (ex. TravisCI) cacerts. Then, when we generate certs for any address, the JVM will implicitly trust them. It would be easier to document and support installing a single certificate rather than generate a certificate per site, which may be messy.

All I can say right now is that I'm super tired today and I need some time to think and get the motivation to do what will certainly be an unpleasant refactor. I want to make sure I do this right so I never have to again.

If you or your team have any ideas for how to make working with SSL certificates easier, I would love to hear them. No matter what, though, I believe we're going to have to stage the environment in some way prior to running the JVM, as the JVM does not like us messing with trust stores and certs from within the JVM (gee, I wonder why it wouldn't like that...).

I'll keep you guys up to date with my work and thoughts.

Note: I didn't design the way it currently works, I just inherited it. I would never have written it as it currently is, but trying to get it to work as is was the lesser of evils, or so I thought.

@walro

walro commented Jun 4, 2016

Copy link
Copy Markdown
Contributor

We appreciate your hard work!

If you or your team have any ideas for how to make working with SSL certificates easier, I would love to hear them. No matter what, though, I believe we're going to have to stage the environment in some way prior to running the JVM, as the JVM does not like us messing with trust stores and certs from within the JVM (gee, I wonder why it wouldn't like that...).

Unfortunately I don't have any ideas, but it sounds reasonable to me that you'd need to do some setup before running the tests. Maybe some other @twingly/dev has an idea though?

@walro

walro commented Jun 4, 2016 •

Copy link
Copy Markdown
Contributor

I suppose you have already thought of it, but have you peeked at the other ports of VCR? See Ports in Other Languages in https://github.com/vcr/vcr/blob/cdf670fc12ada7682966bc3f76bd471efba1eafe/README.md maybe one of the other languages "suffers/suffered" from the same MITM problem? I understand that reading multiple implementations in other languages might not be the first route to go though, but maybe one can get lucky browsing older issues or what not.

@cowboygneox

Copy link
Copy Markdown
Author

Closing as this is no longer relevant.

@cowboygneox cowboygneox closed this Jul 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants