Added cSSLSocket::IsSupported.

The http_request example now use SSL only when is supported.
This commit is contained in:
Martín Lucas Golini
2014-06-01 19:56:22 -03:00
parent 704dbb70cf
commit 8e783de6f7
3 changed files with 16 additions and 1 deletions

View File

@@ -16,7 +16,11 @@ EE_MAIN_FUNC int main (int argc, char * argv []) {
cHttp http;
// We'll work on http://en.wikipedia.org
http.SetHost("https://en.wikipedia.org");
if ( cSSLSocket::IsSupported() ) {
http.SetHost("https://en.wikipedia.org");
} else {
http.SetHost("http://en.wikipedia.org");
}
// Prepare a request to get the wikipedia main page
cHttp::Request request("/wiki/Main_Page");