No virtual method setEndpointIdentificationAlgorithm
See original GitHub issueHello guys. I found one problem.
Lib crashed if it used on Android API less than 24.
Calling this constructor:
public AWSIotMqttClient(String clientEndpoint, String clientId, KeyStore keyStore, String keyPassword) {
super(clientEndpoint, clientId, keyStore, keyPassword);
}
Will cause following exception:
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)
at com.amazonaws.services.iot.client.util.AwsIotTlsSocketFactory.ensureTls(AwsIotTlsSocketFactory.java:124)
at com.amazonaws.services.iot.client.util.AwsIotTlsSocketFactory.createSocket(AwsIotTlsSocketFactory.java:80)
at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:69)
at org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule.start(SSLNetworkModule.java:86)
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:650)
at java.lang.Thread.run(Thread.java:818)
if you will look into the AwsIotTlsSocketFactory#ensureTls method, you’ll see next code:
private Socket ensureTls(Socket socket) {
if (socket != null && (socket instanceof SSLSocket)) {
((SSLSocket) socket).setEnabledProtocols(new String[] { TLS_V_1_2 });
// Ensure hostname is validated againt the CN in the certificate
SSLParameters sslParams = new SSLParameters();
sslParams.setEndpointIdentificationAlgorithm("HTTPS");
((SSLSocket) socket).setSSLParameters(sslParams);
}
return socket;
}
So lib crashed in line: sslParams.setEndpointIdentificationAlgorithm("HTTPS"); if app was launched on android api less than 24.
Here is official docs: SSLParameters#setEndpointIdentificationAlgorithm(java.lang.String)
Direct link to file in repo
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Crash on Android due to missing method ... - GitHub
Fatal Exception: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class ...
Read more >Jetty WebsocketClient does not connect with SSL on android
NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes ...
Read more >Getting this error java.lang.NoSuchMethodError: No ... - Medium
NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; ...
Read more >java.lang.NoSuchMethodError: No virtual method ...
java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters ...
Read more >No such method error setEndpointIdentificationAlgorithm
For our release 1.5.0 we had to update to Java API Version 1.7. Problem. Starting with release 1.5.0 we are using the method...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi everyone again! I made fork of this repo and do some fixes for using this library on Android. Here is link to repo: aws-iot-device-sdk-android Also I published it to my public maven on bintray:
Feel free to use it! @fengsongAWS, also if I did something wrong or violate some license rules tell me, please. Thanks for this sdk!
@Hospes you saved my life… Thank you!!