|
NetBurner 3.5.6
PDF Version |
The HTTP_ACCESS CheckHttpAccess(int sock, int access_level, HTTP_Request &Req) function is used to authenticate the web page access. It will allow access or redirect depending on the file and access rights.
A NetBurner embedded web server application demonstrating secure HTTPS and non-secure HTTP access controls with SSL/TLS certificate authentication.
This application creates a dual-protocol web server that serves content over both HTTP (port 80) and HTTPS (port 443). It implements access control mechanisms to restrict certain content to secure connections only, demonstrating how to build embedded web applications with security-conscious file serving.
The application implements a two-tier access control system:
index.html, content in images/ directoryhttpsdir/ directory (e.g., repeat.html)HTTP_FORBIDDEN statusmain.cpp)Key Functions:**
UserMain(): Application entry point, initializes network stack and starts web serverCheckHttpAccess(): Custom access control function that overrides system defaultsDoCounter(): Demonstrates server-side content generation for SSL connectionsSSL_Image(): Returns different images based on connection securityGetHost() / ShowHost(): Host header parsing utilitiesHTTPS_Ref() / HTTP_Ref(): Generate protocol-specific URL references
Network Initialization:**
Server Certificate (ServerCert.cpp)**
Used for HTTPS connection authentication
Private Key (ServerKey.cpp)**
CheckHttpAccess() function evaluates each request:IsSSLfd() check)http://device-ip/index.html (works)https://device-ip/index.html (works)http://device-ip/httpsdir/repeat.html (forbidden)https://device-ip/httpsdir/repeat.html (works)To modify access control:
CheckHttpAccess() function logic.nbaccess files