In this example we learn how to send Secured GET request to a secured https web page using NodeMCU or ESP8266? As we know all web pages are HTTP protocols, GET and POST are methods of communicating between web browser and the server. Also you look towards server side php Example coding. If you are looking for POST method read here. Show What is HTTPS?HTTPS (HTTP over SSL or HTTP Secure) is the use of Secure Socket Layer (SSL) or Transport Layer Security (TLS) as a sublayer under regular HTTP application layering. HTTPS encrypts and decrypts user page requests as well as the pages that are returned by the Web server. The use of HTTPS protects against eavesdropping and man-in-the-middle attacks. HTTPS was developed by Netscape. HTTPS and SSL support the use of X.509 digital certificates from the server so that, if necessary, a user can authenticate the sender. Unless a different port is specified, HTTPS uses port 443 instead of HTTP port 80 in its interactions with the lower layer, TCP/IP. What is HTTP?The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients and servers. HTTP works as a request-response protocol between a client and server. Each Hypertext Transfer Protocol (HTTP) message is either a request or a response. A server listens on a connection for a request, parses each message received, interprets the message semantics in relation to the identified request target, and responds to that request with one or more response messages. A client constructs request messages to communicate specific intentions, examines received responses to see if the intentions were carried out, and determines how to interpret the results. A web browser may be the client, and an application on a computer that hosts a web site may be the server. Example: A client (browser) submits an HTTP request to the server; then the server returns a response to the client. The response contains status information about the request and may also contain the requested content. Two HTTP Request Methods: GET and POSTTwo commonly used methods for a request-response between a client and server are: GET and POST.
The GET method requests transfer of a current selected representation for the target resource. GET is the primary mechanism of information retrieval and the focus of almost all performance optimizations. Hence, when people speak of retrieving some identifiable information via HTTP, they are generally referring to making a GET request. The GET MethodNote that the query string (name/value pairs) is sent in the URL of a GET request: /test/demo_form.php?name1=value1&name2=value2 Some other notes on GET requests:
Before going directly to programming make sure you have latest version of ESP8266 boardsThis example uses BearSSL which is now default (with the core release 2.5.0 to come, or the current git version, not with core-2.4.2 and older). The example sketch for WiFiClientSecure fails to compile.
ESP8266 GET Example CodeMake changes in wifi settings, SSID and password of your wifi network and change server ip. Also change GET request data as per your server requirements. and SHA1 fingerprint. As for now in order to make SSL request using I'm wondering how you guys handle it, because the fingerprint can change over time. Should I get my server's fingerprint over HTTP from another endpoint and then use HTTPS? Or maybe there's a better approach? asked Mar 10, 2017 at 19:30 7 If you don't care about security and just want to call some https without replacing fingerprint each time it updates, you can use WiFiClientSecure lib and set client.setInsecure() instead. Link |