[ELS61-AUS] TLS 1.2 connection blocked by Connector.open( ) | Thales IoT Developer Community
March 24, 2020 - 8:07am, 1849 views
I developed a Java application for SSL connection and then loaded onto the module.
The following is a part of my code.
SecureConnection secureSocket = (SecureConnection) Connector.open(url);
InputStream secureInputStream = secureSocket.openInputStream();
OutputStream secureOutputStream = secureSocket.openOutputStream();
The call to Connector.open() is blocking when Client can't connect to Server due to a wrong URL or Server breakdown.
The IOException will be thrown about 30 seconds after the call to Connector.open().
Is the default timeout 30 seconds?
Can I set timeout value?
I found another problem when establishing multiple SSL connections.
The connection failure can occur many *****.
Connector.open() would be broke after 30 seconds each time.
As soon as a successful connection has been established, the connection failure occurs after this connection will cause the application block in Connector.open() even after 30 seconds, and then the application also crashes.
Even though I restart application, this problem can't be solved.
I try to let Client to establish connection using a wrong IP, the application blocks in Connector.open(), even if the successful connection has never been estatblished after restarting the applcation.
I can only solve this problem by rebooting the module.
How to break out of Connector.open()?