QuickSpot / walter-arduino

This repository contains all libraries and software to use Walter in the Arduino framework
Other
14 stars 3 forks source link

Trying to access a secure https endpoint and getting an error #10

Open vt-vaio opened 9 months ago

vt-vaio commented 9 months ago

I am trying to access an HTTPS endpoint. Pls see below the code snippets.

...   

 if(m_modem->httpConfigProfile(1, "our.server.com", 443)) {
        debug_out("Successfully configured the http profile");
    } 
    else {
        debug_out("Failed to configure HTTP profile");
    }

...

uint8_t msg [] = "{'id':'240ac4c6f33c','fw_version':'3.0'}";
bool sent = m_modem->httpSend(1, "/our-api-endpoint.php", msg, sizeof(msg), WALTER_MODEM_HTTP_SEND_CMD_POST, WALTER_MODEM_HTTP_POST_PARAM_TEXT_PLAIN);

...

Getting below error

RX: +SQNHTTPRING: 1,400,"text/html; charset=iso-8859-1",442
TX: AT+SQNHTTPRCV=1
RX: <<<<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
Reason: You're speaking plain HTTP to an SSL-enabled server port.<br />
 Instead use the HTTPS scheme to access this URL, please.<br />
</p>
<hr>
<address>Apache/2.4.52 (Ubuntu) Server at our.server.com Port 80</address>
</body></html>

Please help me with an example for how to call an HTTPS POST endpoint using Walter Framework. Thank you.

jonesdptechnics commented 8 months ago

Hi,

TLS (https / coaps) support is still in development. I will get back to you as soon as we have a working prototype.

So this means for now you can only do plain http calls.