← All compilation units

Flyology.HTTP.Server.Development_Certificates

Description

Generates temporary self-signed credentials for local HTTP development. TLS/TCP uses a broadly compatible RSA certificate while the current QUIC profile uses Ed25519. This package invokes the OpenSSL command-line tool; it does not provide or replace production certificate management.

Discard

procedure Discard (Item : in out Identity)

Remove all generated files. Calling Discard repeatedly is harmless. TLS providers must load the PEM paths and callers must read the QUIC values before discarding Item.

Parameters
Item

Credential owner to clear

Generate

procedure Generate
  (Item            : in out Identity;
   OpenSSL_Command : String := "")

Generate self-signed RSA and Ed25519 credentials for localhost and 127.0.0.1. Existing credentials owned by Item are discarded first. An empty OpenSSL_Command selects FLYOLOGY_HTTP_OPENSSL, a conventional OpenSSL 3 installation, or the first openssl command on PATH.

Parameters
Item

Credential owner to initialize

OpenSSL_Command

Optional path to an OpenSSL command with Ed25519 support

Raised exceptions
Program_Error

OpenSSL is unavailable or generation fails

Identity

type Identity is limited private;

Owns generated credential files and removes them during finalization. The object is limited so private-key ownership cannot be copied.

Is_Generated

function Is_Generated (Item : Identity) return Boolean

Report whether Item currently owns generated credential files.

Parameters
Item

Credential owner to inspect

Return value

True after successful Generate and before Discard

QUIC_Certificate_DER

function QUIC_Certificate_DER
  (Item : Identity) return Ada.Streams.Stream_Element_Array

Read the DER-encoded certificate required by the QUIC server profile.

Parameters
Item

Generated credential owner

Return value

Self-signed Ed25519 certificate covering localhost and 127.0.0.1

QUIC_Private_Key

function QUIC_Private_Key
  (Item : Identity)
   return Flyology.QUIC.Connections.Ed25519_Private_Key

Read the raw private key required by the QUIC server profile.

Parameters
Item

Generated credential owner

Return value

Raw 32-byte Ed25519 private key

TLS_Certificate_File

function TLS_Certificate_File (Item : Identity) return String

Return the PEM certificate path for a TLS/TCP server provider.

Parameters
Item

Generated credential owner

Return value

Path to the self-signed RSA certificate

TLS_Private_Key_File

function TLS_Private_Key_File (Item : Identity) return String

Return the PEM private-key path for a TLS/TCP server provider.

Parameters
Item

Generated credential owner

Return value

Path to the RSA private key