increased chunk size
Fork of MTS-Socket by
Diff: Test/TestHTTPS.h
- Revision:
- 36:b6e47b4cdb6d
- Parent:
- 35:c85bea9cb713
--- a/Test/TestHTTPS.h Wed Mar 11 17:27:16 2015 +0000 +++ b/Test/TestHTTPS.h Wed Mar 11 19:07:13 2015 +0000 @@ -34,7 +34,7 @@ string url_post = "/post"; string url_del = "/delete"; string url_stream = "/stream/20"; - string url_auth = "/basic-auth/:user/:passwd"; + string url_auth = "/basic-auth"; MTSLog::setLogLevel(MTSLog::TRACE_LEVEL); @@ -84,9 +84,10 @@ } } - if (http->addRootCACertificate(CERTIFICATE) == HTTP_OK) { + if (http->addRootCACertificate(CERTIFICATE) != HTTP_OK) { Test::assertTrue(false); } + http->setPeerVerification(VERIFY_PEER); Test::end(); @@ -99,12 +100,14 @@ Test::start("HTTPS PUT"); send->put("testing", "put"); Test::assertTrue(http->put(url.c_str(), *send, receive, 10000) == HTTP_OK); + send->clear(); Test::end(); url = secure_url + url_post; Test::start("HTTPS POST"); send->put("testing", "put"); Test::assertTrue(http->post(url.c_str(), *send, receive, 10000) == HTTP_OK); + send->clear(); Test::end(); url = secure_url + url_del; @@ -119,12 +122,13 @@ Test::assertTrue(http->get(url.c_str(), &big, 10000) == HTTP_OK); Test::end(); - url = secure_url + url_auth; - const char user[] = "user",pw[] = "passwd"; - Test::start("HTTPS basic AUTH"); + string url_usr_pw = "/Bob/123"; + url = secure_url + url_auth + url_usr_pw; + const char user[] = "Bob",pw[] = "123"; + Test::start("HTTPS AUTH GET"); Test::assertTrue(http->basicAuth(user,pw) == HTTP_OK); - Test::assertTrue(http->get(url.c_str(), receive, 10000) == HTTP_OK); - Test::assertTrue(http->basicAuth("","") == HTTP_OK); + Test::assertTrue(http->get(url.c_str(), receive, 30000) == HTTP_OK); + Test::assertTrue(http->basicAuth(NULL,NULL) == HTTP_OK); Test::end(); radio->disconnect();