M95 secure sockets (SSL/TLS)

When I open an SSL connection, I get a successful response “AT+QSSLOPEN=0,0” but the server closes the socket immediately and I cannot perform any request.

I control the server side, so I just used “openssl s_server -smg -debug” command to see what happens on the server: the certificate exchange is ok, after that the modem does a long pause (probably checking the certificate) and send the open socket response, then the server get a ClientKeyExchange and other TLS messages from the client but decides to close the connection.

When I use a client like “wget” to do the same request, I can spot one difference in TLS handshake: in this case I see a ServerKeyExchange message which is not sent from the server when I use the M95.

I can do the same request using an UG96 and it works just fine, but with the M95 I hit this wall. Why is that?
Any working example of SSL/TLS sockets with M95?

Dear Sir,
It is better to provide your test at log to check the reason. The following is my test log, it is normal. Please
make sure the certificate have no any problem. Thanks!



image

Thank you, but the problem is not the certificate. I get the same behavior if I specify “seclevel”=0.

This is the log of my connection attempt:

->: AT+QIDNSGIP=“www.howsmyssl.com
rl:
rl: OK
rl:
rl: 35.227.42.200
->: AT+QSSLCFG=“sslversion”,0,3
rl:
rl: OK
->: AT+QSSLCFG=“ciphersuite”,0,“0XFFFF”
rl:
rl: OK
->: AT+QSSLCFG=“seclevel”,0,0
rl:
rl: OK
->: AT+QSSLCFG=“ignorertctime”,1
rl:
rl: OK
->: AT+QSSLOPEN=0,0,“35.227.42.200”,443,0
rl:
rl: OK
rl:
rl: +QSSLOPEN: 0,0
->: AT+QSSLSEND=0,23
rl:
–>GET /a/check HTTP/1.1

rl:
rl: SEND OK
->: AT+QSSLSEND=0,25
rl:
–>Host: www.howsmyssl.com

rl:
rl: SEND OK
->: AT+QSSLSEND=0,25
rl:
–>user-agent: curl/7.53.1

rl:
rl: SEND OK
->: AT+QSSLSEND=0,13
rl:
–>accept: /

rl:
rl: SEND OK
->: AT+QSSLSEND=0,19
rl:
–>connection: close

rl:
rl: SEND OK
->: AT+QSSLSEND=0,2
rl:
–>

rl:
rl: SEND OK
rl:
rl: +QSSLURC: “recv”,0,0
rl:
rl: +QSSLURC: “closed”,0
->: AT+QSSLRECV=0,0,256
rl:
rl: ERROR
->: AT+QSSLCLOSE=0
rl:
rl: ERROR

As you can see the connection is opened successfully but then it is closed remotely by the server.
This happens with any server. Modem revision is M95FAR02A08

Could you try to connect to “www.howsmyssl.com” the same way I did?

Sometimes (rarely) I can receive a first packet from the server, but connection is shut down remotely without being able to receive the whole reply. Looks like some timing issue, but I can’t figure out why the server closes the connection. Is there a timeout parameter?

Dear Sir,
Just as you have said that it can open SSL connection successful, but shut down by the server. It is better to catch the module’s debug log and your server’s wireshark package to check why your server will close the connection. Thanks!
Please contact our local FAE to get the log tool and they will help to analyze the reason. You also can send email to support@quectel.com to get the support from local FAE. Thanks!