NetBurner 3.5.0
PDF Version
 
On-board Cert Generation - Simple

This example shows how to enable auto-generation of self-signed certificates. The certificate will enable secure communication to the system configuration web server and the HTTPS web server of the application. On-board generation of certificates are an alternative to creating your own self-signed certificates and uploading them to your NetBurner device. This simple example should cover most use cases. Please refer to the other examples for additional functionality.

Auto-generated certificates will operate as follows:

  • If enabled and no certificate exists, a certificate will be created on first call to SSL_accept() or SslInitServer().
  • The Common Name (CN) will be the IP address of the device. Alternate names are also supported.
  • The application must ensure it has the correct system time, otherwise the certificate dates will be invalid.
  • Calling the function EnableOnboardCertificateCreation() enables certificate generation.
  • If ENABLE_AUTOCERT_REGEN is defined in predef.h, the certificate will update when it expires, creating a new 1 year certificate. Generation will occur on next SSL/TLS access.
  • If ENABLE_AUTO_CERT_REGEN is defined in predef.h, AUTO_CERT_GEN_CHECK will dictate how frequently a certificate is checked for expiration. The default value is one minute.
  • The certificate will update if the IP address changes to handle environments such as DHCP address assignments.

If the system time is incorrect, the certificate will be invalid.

Additional Examples:

Examples of a HTTPS server with a compiled-in certificate:

  • <NNDK install>\examples\ssl\sslserver
  • <NNDK install>\examples\ssl\SslWebDemo

Examples of uploading a certificate/key pair manually:

  • <NNDK install>\examples\ssl\HttpsDualCert
  • <NNDK install>\examples\ssl\HttpsUploadCert