Using curl with https

Hello,
I am having trouble using curl with https. When I use http://www.google.com it works great, but with https://www.google.com it doesn't work. I just updated to 1.5.3.
Here is my example code:

/*
  Running process using Process class. 

 This sketch demonstrate how to run linux processes
 using an Arduino Yún. 

 created 5 Jun 2013
 by Cristian Maglie

 This example code is in the public domain.

 */

#include <Process.h>

void setup() {
  // Initialize Bridge
  Bridge.begin();

  // Initialize Serial
  Serial.begin(9600);

  // Wait until a Serial Monitor is connected.
  while (!Serial);

  // run various example processes
  runCurl();

}

void loop() {
  Serial.println("Looping!");
    runCurl();
}

void runCurl() {
  // Launch "curl" command and get Arduino ascii art logo from the network
  // curl is command line program for transferring data using different internet protocols
  Process p;        // Create a process and call it "p"
  p.begin("curl");  // Process that launch the "curl" command
  p.addParameter("https://www.google.com"); // Add the URL parameter to "curl"
  p.run();      // Run the process and wait for its termination

  // Print arduino logo over the Serial
  // A process output can be read with the stream methods
  while (p.available()>0) {
    char c = p.read();
    Serial.print(c);
  }
  // Ensure the last bit of data is sent.
  Serial.flush();
}

Thanks in advance.

Regards,
Daniel

drojasug:
Hello,
I am having trouble using curl with https. When I use http://www.google.com it works great, but with https://www.google.com it doesn't work.

I don't understand this, both links are the same.
Anyway, what do you want to retrieve from google.com? I don't see much ascii content in the home page.

Tool Documentation:
http://curl.haxx.se/docs/tooldocs.html

Man page:
http://curl.haxx.se/docs/manpage.html

You likely have an issue with your certificate. You can tell CURL to ignore that and
to get the data anyway. I don't remember how to do that.

Jesse

curl -h |grep certs
 -k, --insecureAllow connections to SSL sites without certs (H)
p.begin("curl");// Process that launch the "curl" command
p.addParameter("-k"); // Add the URL parameter to "curl"
p.addParameter("https://www.google.com"); // Add the URL parameter to "curl"
p.run();// Run the process and wait for its termination

http://www.ibuyopenwrt.com/index.php/2-uncategorised/218-console-version-of-yun-process-client

Plan B: install ca certificate for system wide fix. (curl, wget ...)

wget -O ca-certificates_20140325_ar71xx.ipk https://www.dropbox.com/s/rmvkunea1ifa9zn/ca-certificates_20140325_ar71xx.ipk?dl=0 --no-check-certificate
opkg update
opkg install openssl-util
opkg install ca-certificates_20140325_ar71xx.ipk

http://forum.arduino.cc/index.php?topic=273342.msg1930879#msg1930879

mart256:
I don't understand this, both links are the same.
Anyway, what do you want to retrieve from google.com? I don't see much ascii content in the home page.

The links are different, one is using regular http protocol, and one is using secure https. He's having trouble with the secure connection. I assume the URLs are a simplified example to explain the point, and not the final URL that he is trying to access.

The CA is update very often.

I compile latest up today ca-certificates

wget -O ca-certificates_20150426_ar71xx.ipk https://www.dropbox.com/s/oqm1q833ell0wq3/ca-certificates_20150426_ar71xx.ipk?dl=0 --no-check-certificate
opkg update
opkg install openssl-util
opkg install ca-certificates_20150426_ar71xx.ipk

ShapeShifter:
The links are different, one is using regular http protocol, and one is using secure https. He's having trouble with the secure connection. I assume the URLs are a simplified example to explain the point, and not the final URL that he is trying to access.

Didn't know that difference. Thanks for the acalaration.