SSLHandshakeException during SSL connection

,

Hello,

I’m currently working on an application that does an HTTPS request.

My application is properly running in simulation but when I run it on my STM32F7508-DK I have the following exception:

Exception in thread "WifiTest" javax.net.ssl.SSLHandshakeException: SSL-2.1:E=-129
at java.lang.System.getStackTrace(Unknown Source)
at java.lang.Throwable.fillInStackTrace(Throwable.java:82)
at java.lang.Throwable.(Throwable.java:37)
at java.lang.Exception.(Exception.java:18)
at java.io.IOException.(IOException.java:18)
at javax.net.ssl.SSLException.(SSLException.java:39)
at javax.net.ssl.SSLHandshakeException.(SSLHandshakeException.java:38)
at com.is2t.support.net.ssl.SSLSocketSupport.initialClientHandShake(SSLSocketSupport.java:120)
at com.is2t.support.net.ssl.SSLSocketImpl.doHandShake(SSLSocketImpl.java:162)
at com.is2t.support.net.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:141)

Could you help me on that ?

Regards,

Fabrice

Hello Fabrice,

Regarding our SSL - Error message documentation, the -129 error says that you have to verify a problem on certificate and check date/time on your device. Indeed, when you are opening a SSL connection, you have to update the time of your application. To do so, you can use the NtpUtil class to update the local time.
If you want to know more about this, you can take a look at our Resty example using https connection.

For your information, the application is running properly in simulation because the time is already initialize on your computer.

Best regards,
Corentin

Hi Corentin,

I managed to fix the issue by initializing the time with NtpUtil.

Thanks !

Fabrice