Jump to content
js9013

.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();
  }
}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×