Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: GR-PEACH_Azure_Speech
Fork of HTTPClient-SSL by
Diff: HTTPClient.h
- Revision:
- 23:f7e0ab858911
- Parent:
- 19:1e2f05809eb1
- Child:
- 26:bf979804b653
diff -r 14ecc2b2e282 -r f7e0ab858911 HTTPClient.h
--- a/HTTPClient.h Thu Apr 17 12:23:47 2014 +0000
+++ b/HTTPClient.h Sat Jul 12 07:11:39 2014 +0000
@@ -58,15 +58,13 @@
HTTPClient();
~HTTPClient();
-#if 0 //TODO add header handlers
/**
Provides a basic authentification feature (Base64 encoded username and password)
Pass two NULL pointers to switch back to no authentication
@param user username to use for authentication, must remain valid durlng the whole HTTP session
@param user password to use for authentication, must remain valid durlng the whole HTTP session
*/
- void basicAuth(const char* user, const char* password); //Basic Authentification
-#endif
+ HTTPResult basicAuth(const char* user, const char* password); //Basic Authentification
//High Level setup functions
/** Execute a GET request on the URL
@@ -122,7 +120,9 @@
@return The HTTP response code of the last request
*/
int getHTTPResponseCode();
- void setHeader(char *header) ;
+
+ void setHeader(char *header) ; /* set http headers */
+ HTTPResult setSSLversion(int minorV) ; /* set SSL/TLS version. 0: SSL3, 1: TLS1.0, 2: TLS1.1, 3: TLS1.2 */
private:
enum HTTP_METH {
@@ -139,7 +139,8 @@
HTTPResult flush(void); //0 on success, err code on failure
HTTPResult parseURL(const char* url, char* scheme, size_t maxSchemeLen, char* host, size_t maxHostLen, uint16_t* port, char* path, size_t maxPathLen); //Parse URL
void cyassl_free(void) ;
-
+ HTTPResult bAuth(void) ;
+
//Parameters
int m_timeout;
@@ -149,7 +150,9 @@
int m_httpResponseCode;
char * header ;
+
/* for CyaSSL */
+ int SSLver ;
uint16_t port;
struct CYASSL_CTX* ctx ;
struct CYASSL * ssl ;
