Thales' cellular IoT products business is now part of Telit Cinterion, find out more.

You are here

ELS61 ER2 with PAHO MQTT: 112 SSL-Error: mp_exptmod error state | Telit Cinterion IoT Developer Community

September 23, 2021 - 8:21am, 2380 views

Good morning,

we are a proud user of a new module based on ELS61ER2.

We are using the Eclipse PAHO Mqtt library shared in this forum for connecting to MQTT. We manged it to use TLS encryption for different modules now (EHS5 ARev >42, ELS61 ER1). We created our own CA and certificates for our servers.

With new module ELS61ER2 we received two different errors (depending on configuration):
- Unable to connect to server (32103) - java.io.IOException: -112 SSL-Error: mp_exptmod error state
- Unable to connect to server (32103) - java.io.IOException: TLS/SSL: SNI extension used without domain

The second error occurs if we try to connect with ip (e.g. ssl://111.222.0.241:30005). The ip is inside certificate's SAN. This worked with older devices.
The first error occurs if we connect via dns name: (e.g. ssl://my.domain.com:30005).

We followed the code until this fragment in com.cwm.net.SSLMicroNetworkModule.java

 public void start() throws IOExceptionMqttException {
        final String methodName = "start";
        try {
            log.fine(className, methodName, "252"new Object[] { uri });
            connection = (SecureConnection) Connector.open(uri);
            connection.setSocketOption(SocketConnection.LINGER, 5); 
            
            in = connection.openInputStream();
            out = connection.openOutputStream();
        } catch (IOException ex) {
            // @TRACE 250=Failed to create TCP socket
            log.fine(className, methodName, "250"null, ex);
            throw new MqttException(
                    MqttException.REASON_CODE_SERVER_CONNECT_ERROR, ex);
        }
    }

At this place the exception is thrown but I have no clue why.

On our server side I see the connection but it breaks before payload is transmitted. So I'm going to prepare everything again for dumping the network traffic. But maybe someone already has better idea or can say someone about the error message? laugh

Best regards

Kris Budde