-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
initChannel results in System.err (two way ssl authentication) #8158
Comments
would help to see a stacktrace |
Unfortunately, all that is available is the System.err. |
I looked at your stackoverflow and I feel like something is missing. Netty normally using a logging framework sl4j. I have not seen a printout as you have shown in the past when I have caused SSL Errors. Can you provide you code in a complete test case. Providing runnable code (doesn't have to be your private code) you can mock the private stuff; will allow us to run and actually re-produce the bug on our systems. Error you posted on SO: |
This is the output get: I have used slf4j and log4j in my lib used on Android but not been able to make it work. Requires some gradle fiddling because Android has it's own log/slf4j lib. I will make a junit test running on java 8 and we will see any difference then. I will post the results no matter if I am able to resolve things myself. Thanks for your input. |
Before I post the project with the JUnit test I want to know if this stacktrace helps (I had to try-catch the contents of initChannel): java.lang.IllegalArgumentException: Duplicate handler name: ssl |
This is line 91: |
Yes that helps a lot. Found your issue already. So something is up because your handler is being added twice it appears |
Is it not legal to add both keyManager and trustManager to sslBuilder? That's the only way I can see I have added something twice. Line 91 is the only place I add a channelhandler named "ssl". |
Use "```" before and after or highlight your code and select code so everyone can see it. I know you put it on stack overflow; kinda of a pain in the ass to go back and fourth. I copied your code from SO for everyone watching.
|
Try this... use SslContext.newHandler(); Ignore my nettySslCredentialts that's my own class. But the point is to use the contexts to grab a new handler. SslContext use the channel or channel handler context .alloc() which gets the default bytebuf allocater use in the channel. Or if you use your own.
|
Hmmm ... using the test itself as the inbound handler was not a good idea. The test ran twice and the exception resulted. Now, with the inbound handler a separate class the test runs fine. I am able to connect. |
Cool then see you on the flip side; if all is working. Probably want to close this issue as well. |
Maybe you could fix that no output/stacktrace print is shown from inside initChannel? Anonymous class? |
I am not a active participant to writing fixes to the code base; just try to read through the source code to help those who do not know how to or take the time themselves to review the source code; also answering questions that are not necessary and issue with the library itself. This may be related to Issues 6096. You would have to check and if it is merge this with that issue. I also do not seem to have issues with exceptions popping from my init channel; it throws exceptions for me. |
Thanks. Seems 6096 is the same thing. |
And comment: This happens on Android. |
… Exception Motivation: We had a report that the exception may not be correctly propagated. This test shows it is. Modifications: Add testcase. Result: Test for #8158
I added a test for this to show it works as expected in the latest netty release: #8188 Closing the issue |
Expected behavior: SSL request as coded
Actual behavior: No SSL Request - System err.
Steps to reproduce: Copy code in https://stackoverflow.com/questions/51431692/w-system-err-at-io-netty-channel-abstractchannelabstractunsafe-ensureopen to initChannel
Minimal yet complete reproducer code (or URL to code):
https://stackoverflow.com/questions/51431692/w-system-err-at-io-netty-channel-abstractchannelabstractunsafe-ensureopen
Netty version: 4.1.28.Final
JVM version (e.g.
java -version
) Android 8.0OS version (e.g.
uname -a
)Android 8.0
The text was updated successfully, but these errors were encountered: