Cannot init SSL-Context | Telit Cinterion IoT Developer Community
November 17, 2017 - 2:51am, 2583 views
Hi
I have developed a software to run on EHS-6 module. The software will keep a connection to AWS server and periodically send data to the server. When the AWS connection drops, the software will then try to re-establish the connection again.
The issue I am facing now is that after about 4-5 days of continuous operation, the software catches exception IOException Cannot init SSL-Context whenever it tries to establish connection to AWS server. I left it retrying for a day but the same exception was caught everytime it attempted to make connection. I can only recover by resetting the module.
I have no idea what might cause this exception? Can I please get some advice?
Thanks.
Regards
Thu Hang
Hello,
Could you please provide some more information?
What is the firmware version (ATI1 reply)?
The connection is not closed but kept open until it is dropped. Are all the resources released after that?
Can you ***** how frequently there is a need to reestablish the connection, for exampe how many connections are established per day?
Thanks,
Bartłomiej
Hi
I am using ARN51.
I stepped through the mqtt source codes and found that the IOException Cannot init SSL-Context is thrown when the software is trying to open a secure connection.
try {
secConn = (SecureConnection) Connector.open(uri);
} catch (IOException ioe) {
System.out.println("IOException " + (ioe.getMessage() != null ? ioe.getMessage() : "null") + " " + uri);
throw ioe;
}
May I ask what kind of resource might cause this exception if not properly released? I will try to look for it in the source.
I see that the connection dropped about every 12hrs, that makes 2 connections to be established per day.
Thanks.
Regards
Thu Hang
Hello,
You have the latest firmware.
You should close the socket connection if not needed to release the resources. Please make sure that your code closes the SecureConnection each time. Are you using any mqtt library? Maybe there's a problem inside.
Regards,
Bartłomiej
Hi
Yes I am using a mqtt library. I was looking through the source of the library I am using but couldn't find any line that closes the SecureConnection.
I also took a look at the mqtt project posted in this forum and saw that the source made a call to close all the opened resource upon connection shutdown. I will try out this source to see if the issue can be solved.
Thanks.
Regards
Thu Hang
Yes we have a demo mqtt project on the forum. Please try. I hope that it will help.
Regards,
Bartłomiej