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

Add PlainSocketFactory and make it a default fallback #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Darkyenus
Copy link

Result of #1. Adds PlainSocketFactory, which is a simplified version of AnonymousSslSocketFactory without any SSL - just through plain sockets. This new socket factory is then made default fallback, instead of the anonymous one, which is still available through environment key. All tests are passing.

After a few hours of messing with proxies and RMI, I am so happy I found this project. Thank you for creating and publishing it!

@ghost
Copy link

ghost commented Apr 6, 2020

Hi Darkyenus, for me AnonymousSslSocketFactoryTest are failing.

[ERROR] Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.128 s <<< FAILURE! - in nl.futureedge.simple.jmx.socket.AnonymousSslSocketFactoryTest [ERROR] ok(nl.futureedge.simple.jmx.socket.AnonymousSslSocketFactoryTest) Time elapsed: 0.098 s <<< ERROR! nl.futureedge.simple.jmx.socket.SslConfigurationException: None of the specified values could be added. Wanted: [TLS_DH_anon_WITH_AES_128_GCM_SHA256, TLS_DH_anon_WITH_AES_128_CBC_SHA256, TLS_DH_anon_WITH_AES_128_CBC_SHA] Supported: [TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256] at nl.futureedge.simple.jmx.socket.AnonymousSslSocketFactoryTest.ok(AnonymousSslSocketFactoryTest.java:15)

@Darkyenus
Copy link
Author

It has been a long time, so I no longer remember how exactly did the code work or how to fix your problem. However, it is possible that the problem you encountered is the same as #1, for which this is a workaround.

If it is the case (and I suspect that it is), the test is failing because you are using too recent JRE which no longer supports anonymous ciphers (Wanted: [TLS_DH_anon_WITH_AES_128_GCM_SHA256, TLS_DH_anon_WITH_AES_128_CBC_SHA256, TLS_DH_anon_WITH_AES_128_CBC_SHA]). If you run the tests on an older JRE, all tests should pass. This PR makes it possible to use the project even if you are on a new JRE, on which the anon ciphers are not supported and the test you mention fails.

@ghost
Copy link

ghost commented Apr 8, 2020

I am using it with Java 8. I am not an expert in this area, what do you suggest here to bypass this problem. Should I remove AnonymousSslSocketFactory in total or maybe remove setting of EnabledCipherSuites?
I'll probably need to create another branch, where I would resolve this issue, so that I'll be able to use it from github.

@Darkyenus
Copy link
Author

I don't know what is your final goal, but if you just want to use the plugin, you can use my branch directly and just ignore the failed test, the code (in my branch) is structured in a way that can deal with that functionality being broken, I think.

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.

1 participant