Jump to content
43oh

.sslConnect() not working


Recommended Posts

I have a very basic requirement to send a HTTPS request to AWS. I am using the basic sample code from Energia for my MSP432. I have no issues establishing an unsecured HTTP request using .connect(), but AWS requires HTTPS. To that end, I am trying to use the .sslConnect() function provided in Energia to no avail - I am not able to establish a connect with the AWS server.

Can anyone suggest what my issues are with the code below? Are there common issues I should look at to debug? Thank you!

char server[] = "xxxxxxxx.execute-api.us-xxxx-2.amazonaws.com";   

{
  Serial.println("\nStarting connection to server...");
  // if you get a connection, report back via serial:
  if (client.sslConnect(server, 8443)) {
    Serial.println("connected to server");
    // Make a HTTP request:
    client.println("GET /xxxx/myAWSfunction HTTP/1.1");
    client.println("Host: xxxx.execute-api.us-xxxx-2.amazonaws.com");
    client.println("Connection: close");
    client.println();
  }
}

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...