NetBurner 3.5.8
PDF Version
HTTPS Application Update

Example Path: examples/SSL/AppUpdate

NetBurner Secure Application Update Server

Overview

This application provides a web-based interface for updating embedded application code remotely over an encrypted connection. It runs an HTTPS-only web server that accepts application image uploads through a web browser, protected with HTTP Basic authentication. It is the secure sibling of the plain-HTTP HTML Application File Post example.

How It Works

  1. Initialization: The application starts the HTTPS web server with StartHttps(443, 0). The second parameter of 0 disables the plain-HTTP listener, so the update page is only reachable over TLS.
  2. Authentication: The update handler is registered behind an access group. The CheckHttpAccess() callback prompts for credentials (user up, password date, realm NetBurner) before the upload is accepted. Because the connection is TLS-encrypted, the Basic authentication credentials are encrypted in transit along with the firmware image.
  3. File Upload: The user uploads an application .bin from the web interface.
  4. Processing: The uploaded file is streamed into flash with ReadBinaryApplicationCodeFromStream().
  5. Reboot: On a successful update, the device sends a confirmation page and reboots into the new application after a 5-second delay.

TLS Certificate

The TLS server uses the certificate and key compiled in from src/ServerCert.cpp and src/ServerKey.cpp. This is a demonstration certificate, so browsers will show a trust warning; replace it with your own certificate for production use. For other ways to provision certificates, see:

Credentials

  • Username: up
  • Password: date
  • Realm: NetBurner

The credentials are hardcoded in CheckHttpAccess() and should be changed for production use.

Usage

  1. Build and deploy the application to your NetBurner device
  2. Browse to https://<device IP address> and accept the certificate warning
  3. Select your application .bin file and click Send Update File
  4. Enter the username and password when prompted
  5. Wait for the update confirmation and automatic reboot

Related Examples