TLS policies
The policy is chosen per client, per server listener and per request (ADR-0020). The default is hybrid.
| Policy | Key exchange offered | Classical peer | Use it for |
|---|---|---|---|
hybrid (default) |
X25519MLKEM768 first, then X25519, secp256r1, secp384r1. TLS 1.3, TLS 1.2 allowed over TCP |
connects, post_quantum = false |
general purpose: post-quantum wherever the peer supports it |
pq-required |
X25519MLKEM768 only, TLS 1.3 |
refused with PQ_REQUIRED |
no downgrade allowed |
cnsa2 |
MLKEM1024 only, TLS_AES_256_GCM_SHA384, ML-DSA-87 or P-384 certificates. TCP only (no HTTP/3) |
refused with PQ_REQUIRED |
US National Security Systems alignment (CNSA 2.0) |
classical |
X25519, secp256r1, secp384r1 |
connects | explicit opt-in: legacy interop, benchmarking |
profile: "default" is an older option name and an alias of hybrid. require_pq: true is sugar for pq-required.
Set the policy
Section titled “Set the policy”let r = unicomm_core::ffi::request_value(r#"{"url":"https://localhost:8446/","policy":"pq-required","ca_path":"certs/ca.pem"}"#);// r["ok"] == false and r["error_code"] == "PQ_REQUIRED" when the server cannot do X25519MLKEM768cfg, err := goclient.TLSConfig(goclient.PQRequired) // goclient.Hybrid, goclient.PQRequired, goclient.Classicalc := &unicomm.Client{Policy: unicomm.PolicyPQRequired} // client defaultr, err := c.Do(unicomm.Request{Method: "GET", URL: u, Policy: unicomm.PolicyCNSA2}) // per-request overrideconst c = new Client({ policy: "pq-required" });await c.request(url, { policy: "cnsa2" }); // per-request overridec = unicomm.Client(policy=unicomm.PQ_REQUIRED)c.get(url, policy=unicomm.CNSA2) # per-request overridevar c = new UniCommClient { Policy = Policy.PqRequired };var r = c.Get(url, Policy.Cnsa2); // per-request overrideUniComm c = UniComm.builder().policy(UniComm.Policy.PQ_REQUIRED).build();UniComm.Response r = c.get(url, UniComm.Policy.CNSA2); // per-request overrideunicomm curl --policy pq-required https://localhost:8446/unicomm server --policy pq-required # server: make the main listener strictunicomm server --profile cnsa2 # server: also listen on :8445 with cnsa2Where cnsa2 stops
Section titled “Where cnsa2 stops”- Go has no ML-KEM-1024 in
crypto/tls, so the pure-Go client offers hybrid, pq-required and classical only. Use the Rust core or a binding for cnsa2. - HTTP/3 with cnsa2 is rejected as
BAD_INPUT: rustls QUIC needsTLS13_AES_128_GCM_SHA256to be negotiable, which an AES-256-only profile forbids. - Browsers cannot do cnsa2. It is for native and internal links.
- The cnsa2 chain still has a P-384 root, so it is not yet fully CNSA 2.0 (ADR-0016). It is an alignment target, not a certification.
Certificates
Section titled “Certificates”Roots and leaves are ECDSA P-384 with SHA-384, with an ML-DSA path (ADR-0015). The server and unicomm ca init / cert issue issue P-384. Run
unicomm cbom to find older P-256 certificates and reissue them. Public WebPKI moves to post-quantum signatures later (Merkle Tree Certificates);
until then public sites keep classical certificates.