-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Crash on Android due to missing method setEndpointIdentificationAlgorithm
on 1.5.0.
#1011
Comments
The library requires Java API Level 1.7. I don't know what that means for supported android versions. Could you check this for me? Best regards, |
@PhilipRoman We could document this exception and the workaround and include how do to hostname verficiation then. What do you think? Best regards, |
I'm not sure what Java 1.7 means: Please clarify. Thanks. |
Java SE 7 |
Yes, Android API 21 is Java 7. |
Looks like the added |
@marci4 Thanks! |
@marci4 The only other way would be to check for the existence of Not sure if it is worth the extra complexity (although it would make it easier for Android users) |
@PhilipRoman the reflection would result in a silent fail. Then there is no indication if hostname validation is active or not. |
@or-else what do you think about the following idea: I will move the method call setEndpointIdentificationAlgorithm inside of OnSetSSLParameters. It is not ideal but you would be able to use this library without being forced to require a never Android API version. Best regards, |
@or-else and @PhilipRoman if you are both fine with the proposed changes, I would do a hotfix release for 1.5.1. Best regards, |
@marci4 Yes, setting SNI parameter in |
Snapshot looks good, pushing release. Workaround is documented here https://github.com/TooTallNate/Java-WebSocket/wiki/No-such-method-error-setEndpointIdentificationAlgorithm Best regards, |
Websocket library 1.5.1 java.lang.NoSuchMethodError No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar) 1 e.a.f.b.a(WebSocketClient.java:5)2 e.a.f.b.run(WebSocketClient.java:19) |
I think I can now understand why most of the websocket libraries I found require |
Websocket library 1.5.0
The same code was not crashing on 1.4.1
This is the entire stack trace. I got it through Crashlytics so I cannot describe steps that led to it.
Android 5.0.1 (API 21).
Brand: HUAWEI
Model: P8 Lite
The text was updated successfully, but these errors were encountered: