<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Stormedo</title>
    <description>The latest articles on DEV Community by Stormedo (@stormedo).</description>
    <link>https://dev.to/stormedo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4284784%2Fd5432663-7856-4ae0-93b9-993cb2ccc965.png</url>
      <title>DEV Community: Stormedo</title>
      <link>https://dev.to/stormedo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stormedo"/>
    <language>en</language>
    <item>
      <title>Post-quantum TLS in Rust: reqwest does not prefer it by default</title>
      <dc:creator>Stormedo</dc:creator>
      <pubDate>Sat, 05 Dec 2026 16:41:08 +0000</pubDate>
      <link>https://dev.to/stormedo/post-quantum-tls-in-rust-reqwest-does-not-prefer-it-by-default-171</link>
      <guid>https://dev.to/stormedo/post-quantum-tls-in-rust-reqwest-does-not-prefer-it-by-default-171</guid>
      <description>&lt;p&gt;reqwest 0.13.4 with its default rustls backend supports the hybrid post-quantum key exchange X25519MLKEM768, but offers it last. Servers that prefer the hybrid have to ask for it with a HelloRetryRequest, which costs an extra round trip, and some servers settle on plain X25519 instead. The fix is one dependency line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo add rustls@0.23.41 --no-default-features --features prefer-post-quantum
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cargo merges features across the dependency graph, so the rustls that reqwest uses gets &lt;code&gt;prefer-post-quantum&lt;/code&gt; too and offers X25519MLKEM768 first. Use the rustls version your lockfile already has, so there is still one copy of rustls in the build.&lt;/p&gt;

&lt;p&gt;Everything below applies to reqwest 0.13.4 and rustls 0.23.41 with the aws-lc-rs provider. reqwest 0.12 is different and has its own section near the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  What X25519MLKEM768 is and why it matters now
&lt;/h2&gt;

&lt;p&gt;Every TLS 1.3 connection starts with a key exchange that agrees on the keys for the session. X25519 is the classical key exchange most connections use today. X25519MLKEM768 runs X25519 and ML-KEM-768, a key encapsulation mechanism standardized by NIST in FIPS 203, together and combines both results. An attacker has to break both to recover the session keys.&lt;/p&gt;

&lt;p&gt;The reason to use it before large quantum computers exist is "record now, decrypt later". Someone who records encrypted traffic today can keep it. If X25519 is broken in the future, a recording of a classical handshake can be decrypted then. A recording of a hybrid handshake would also need ML-KEM-768 to be broken. That matters for traffic whose content still needs to be private years from now, such as personal data or credentials in request bodies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why reqwest offers it last
&lt;/h2&gt;

&lt;p&gt;rustls 0.23.41 turns &lt;code&gt;prefer-post-quantum&lt;/code&gt; on by default, but reqwest depends on rustls with &lt;code&gt;default-features = false&lt;/code&gt; and enables only &lt;code&gt;std&lt;/code&gt; and &lt;code&gt;tls12&lt;/code&gt; (reqwest-0.13.4 &lt;code&gt;Cargo.toml&lt;/code&gt;, lines 384 to 391). The feature stays off unless something else in your build turns it on.&lt;/p&gt;

&lt;p&gt;The feature only changes the order in the aws-lc-rs provider's default key exchange groups (rustls-0.23.41 &lt;code&gt;src/crypto/aws_lc_rs/mod.rs&lt;/code&gt;, lines 247 to 256):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="no"&gt;DEFAULT_KX_GROUPS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;dyn&lt;/span&gt; &lt;span class="nc"&gt;SupportedKxGroup&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="cp"&gt;#[cfg(feature = "prefer-post-quantum")]&lt;/span&gt;
    &lt;span class="n"&gt;kx_group&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;X25519MLKEM768&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;kx_group&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;X25519&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;kx_group&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;SECP256R1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;kx_group&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;SECP384R1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="cp"&gt;#[cfg(not(feature = "prefer-post-quantum"))]&lt;/span&gt;
    &lt;span class="n"&gt;kx_group&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;X25519MLKEM768&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;reqwest 0.13.4 uses the process-wide default rustls provider if your program installed one, and otherwise &lt;code&gt;rustls::crypto::aws_lc_rs::default_provider()&lt;/code&gt; (reqwest-0.13.4 &lt;code&gt;src/async_impl/client.rs&lt;/code&gt;, lines 719 to 721 and 2482 to 2494). Its default &lt;code&gt;rustls&lt;/code&gt; feature turns on rustls's &lt;code&gt;aws-lc-rs&lt;/code&gt; feature (reqwest-0.13.4 &lt;code&gt;Cargo.toml&lt;/code&gt;, lines 86 to 90 and 169 to 173). Without the feature, the client offers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;X25519, secp256r1, secp384r1, X25519MLKEM768
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;rustls sends a key share only for the group it prefers, here X25519. A server that would rather use the hybrid sends a HelloRetryRequest naming X25519MLKEM768, and the client sends a second ClientHello with that share. That is a full extra round trip before the handshake can continue. Other servers accept the X25519 share they already have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check your own build
&lt;/h2&gt;

&lt;p&gt;See which rustls features Cargo enables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo tree -e features -i rustls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If no line reads &lt;code&gt;rustls feature "prefer-post-quantum"&lt;/code&gt;, the hybrid is offered last. Also run &lt;code&gt;cargo tree -d&lt;/code&gt; and check that rustls is not listed: two copies of rustls would mean the feature might land on a different copy from the one reqwest uses.&lt;/p&gt;

&lt;p&gt;To print the order directly, take the provider the same way reqwest does. This needs rustls as a direct dependency, which the fix below adds anyway:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sync&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Arc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;rustls&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;aws_lc_rs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;CryptoProvider&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CryptoProvider&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get_default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cloned&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unwrap_or_else&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nc"&gt;Arc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;aws_lc_rs&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;default_provider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;group&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kx_groups&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"{:?}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;name&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without the feature it prints &lt;code&gt;X25519&lt;/code&gt;, &lt;code&gt;secp256r1&lt;/code&gt;, &lt;code&gt;secp384r1&lt;/code&gt;, &lt;code&gt;X25519MLKEM768&lt;/code&gt;. If your program installs its own provider with &lt;code&gt;install_default()&lt;/code&gt;, call this after that, because reqwest will use that provider instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;Add rustls as a direct dependency with the feature and nothing else:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo add rustls@0.23.41 --no-default-features --features prefer-post-quantum
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="na"&gt;rustls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.23.41"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;features&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;features&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"prefer-post-quantum"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;prefer-post-quantum&lt;/code&gt; also turns on &lt;code&gt;aws_lc_rs&lt;/code&gt;, which reqwest already enables, so no new crypto backend comes in. Then confirm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cargo tree -e features -i rustls&lt;/code&gt; now includes &lt;code&gt;rustls feature "prefer-post-quantum"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cargo tree -d&lt;/code&gt; still shows no second rustls.&lt;/li&gt;
&lt;li&gt;The program above prints &lt;code&gt;X25519MLKEM768&lt;/code&gt;, &lt;code&gt;X25519&lt;/code&gt;, &lt;code&gt;secp256r1&lt;/code&gt;, &lt;code&gt;secp384r1&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We checked these three results with reqwest 0.13.4 (&lt;code&gt;default-features = false&lt;/code&gt;, &lt;code&gt;features = ["rustls"]&lt;/code&gt;) and rustls 0.23.41.&lt;/p&gt;

&lt;p&gt;Nothing in your code uses the new dependency, so a later upgrade or a dependency cleanup can drop it without anyone noticing. A small test keeps it in place:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="cp"&gt;#[cfg(test)]&lt;/span&gt;
&lt;span class="k"&gt;mod&lt;/span&gt; &lt;span class="nf"&gt;tests&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sync&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Arc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="cp"&gt;#[test]&lt;/span&gt;
    &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;outbound_tls_prefers_post_quantum_key_exchange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rustls&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;CryptoProvider&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get_default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cloned&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unwrap_or_else&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nc"&gt;Arc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rustls&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;aws_lc_rs&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;default_provider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kx_groups&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;name&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nf"&gt;assert_eq!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rustls&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;NamedGroup&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;X25519MLKEM768&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Measured handshakes
&lt;/h2&gt;

&lt;p&gt;We measured 14 HTTPS hosts from Stormedo's production delivery server on 2026-12-05. A small program built with rustls 0.23.41, the aws-lc-rs default provider and the platform certificate verifier connected to each host twice: once with the old group order and once with the hybrid first. It recorded the negotiated group and whether a HelloRetryRequest happened. We ran it twice and both runs were identical. Every handshake was TLS 1.3.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Host&lt;/th&gt;
&lt;th&gt;Before: group&lt;/th&gt;
&lt;th&gt;Before: retry&lt;/th&gt;
&lt;th&gt;After: group&lt;/th&gt;
&lt;th&gt;After: retry&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;cloudflare.com&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="http://www.google.com" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;aws.amazon.com&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;api.github.com&lt;/td&gt;
&lt;td&gt;X25519&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;X25519&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hooks.slack.com&lt;/td&gt;
&lt;td&gt;X25519&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;X25519&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;api.stripe.com&lt;/td&gt;
&lt;td&gt;X25519&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;X25519&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="http://www.microsoft.com" rel="noopener noreferrer"&gt;www.microsoft.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;X25519&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;api.zeptomail.com&lt;/td&gt;
&lt;td&gt;X25519&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;discord.com&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;api.openai.com&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hooks.zapier.com&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;api.vercel.com&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;api.axiom.co&lt;/td&gt;
&lt;td&gt;X25519&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;X25519&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;live.dodopayments.com&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;X25519MLKEM768&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Before the fix, 8 of 14 hosts negotiated X25519MLKEM768, and all 8 needed a HelloRetryRequest first. After it, 10 of 14 negotiated the hybrid and none needed a retry. &lt;a href="http://www.microsoft.com" rel="noopener noreferrer"&gt;www.microsoft.com&lt;/a&gt; and api.zeptomail.com moved from X25519 to the hybrid: they accept it when it is offered first but do not ask for it. GitHub, Slack, Stripe and Axiom stayed on X25519 either way.&lt;/p&gt;

&lt;p&gt;The cost is size. With the hybrid first, rustls sends an X25519MLKEM768 key share of 1216 bytes plus a separate X25519 share, so servers that only want X25519 can still use it without a retry (rustls-0.23.41 &lt;code&gt;src/client/hs.rs&lt;/code&gt;, lines 276 to 296). The first client flight grew from about 245 bytes to about 1465 bytes. That no longer fits in one TCP segment on a 1500-byte MTU path, so it goes out as two. For a server that supports the hybrid, two segments in one flight cost less than the full extra round trip of a HelloRetryRequest. For a server that does not, the larger ClientHello is pure overhead. We saw no failed handshakes on any of the 14 hosts.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does not do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It protects the key exchange only.&lt;/strong&gt; Certificates and their signatures are still classical. A future attacker who can break them could impersonate a server in a live connection. That does not help decrypt traffic recorded earlier, which is the risk this change addresses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Servers without the hybrid stay classical.&lt;/strong&gt; Four of the 14 hosts above still use X25519. The client cannot change that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It is not "quantum safe".&lt;/strong&gt; It removes one known way that recorded traffic could be read later. It says nothing about the rest of the system, and nobody can promise how ML-KEM will hold up over decades.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It needs the aws-lc-rs provider.&lt;/strong&gt; The rustls 0.23.41 &lt;code&gt;ring&lt;/code&gt; provider offers only X25519, secp256r1 and secp384r1 (rustls-0.23.41 &lt;code&gt;src/crypto/ring/mod.rs&lt;/code&gt;, lines 176 to 180). With &lt;code&gt;ring&lt;/code&gt;, this feature does nothing for your connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What about reqwest 0.12?
&lt;/h2&gt;

&lt;p&gt;reqwest 0.12 behaves differently. We read the 0.12.28 source but did not measure it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Its &lt;code&gt;default-tls&lt;/code&gt; feature uses native-tls, not rustls (reqwest-0.12.28 &lt;code&gt;Cargo.toml&lt;/code&gt;, lines 107 to 111). Which groups it offers depends on the platform's TLS library, and this guide does not cover it.&lt;/li&gt;
&lt;li&gt;Its &lt;code&gt;rustls-tls&lt;/code&gt; features select the &lt;code&gt;ring&lt;/code&gt; provider (reqwest-0.12.28 &lt;code&gt;Cargo.toml&lt;/code&gt;, lines 148 to 167), and without a process-wide default it uses &lt;code&gt;rustls::crypto::ring::default_provider()&lt;/code&gt; (reqwest-0.12.28 &lt;code&gt;src/async_impl/client.rs&lt;/code&gt;, lines 763 to 770). &lt;code&gt;ring&lt;/code&gt; offers no X25519MLKEM768 at all, so &lt;code&gt;prefer-post-quantum&lt;/code&gt; alone changes nothing. reqwest 0.12 does use a provider installed with &lt;code&gt;rustls::crypto::aws_lc_rs::default_provider().install_default()&lt;/code&gt; before the client is built. That provider offers the hybrid, but puts it first only if rustls's &lt;code&gt;prefer-post-quantum&lt;/code&gt; feature is also on, so you need both.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you can, upgrade to reqwest 0.13 and use the fix above.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this came from
&lt;/h2&gt;

&lt;p&gt;We found this while checking the outbound TLS of &lt;a href="https://stormedo.com" rel="noopener noreferrer"&gt;Stormedo&lt;/a&gt;, a service we build that sends HTTP requests for you and retries them. Its delivery workers use reqwest 0.13.4, and we made this change to them, so deliveries to HTTPS destinations now offer X25519MLKEM768 first. The measurements above were taken from the same servers. The entry is in the &lt;a href="https://stormedo.com/changelog/" rel="noopener noreferrer"&gt;changelog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post first appeared on the &lt;a href="https://stormedo.com/guides/reqwest-post-quantum-tls/" rel="noopener noreferrer"&gt;Stormedo guides&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>security</category>
      <category>cryptography</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>GitHub Actions schedule not running? Trigger the workflow from outside GitHub</title>
      <dc:creator>Stormedo</dc:creator>
      <pubDate>Sat, 05 Dec 2026 13:27:49 +0000</pubDate>
      <link>https://dev.to/stormedo/github-actions-schedule-not-running-trigger-the-workflow-from-outside-github-4j41</link>
      <guid>https://dev.to/stormedo/github-actions-schedule-not-running-trigger-the-workflow-from-outside-github-4j41</guid>
      <description>&lt;p&gt;If a workflow with &lt;code&gt;on: schedule&lt;/code&gt; runs late or not at all while manual runs still work, you can stop depending on GitHub's scheduler. Add a &lt;code&gt;workflow_dispatch&lt;/code&gt; trigger, then call GitHub's workflow dispatch API on a cron from outside GitHub. A dispatched run starts when the API call arrives, not when GitHub's scheduler gets to it.&lt;/p&gt;

&lt;p&gt;This post covers the GitHub side step by step, then three ways to send the call on a timer: cron-job.org, a Cloudflare Worker, and Stormedo. Disclosure: we build Stormedo. The other two options are free, and every step before that works the same whichever one you pick.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why scheduled workflows run late or not at all
&lt;/h2&gt;

&lt;p&gt;GitHub documents these limits on the &lt;code&gt;schedule&lt;/code&gt; event:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Runs can be delayed or dropped.&lt;/strong&gt; "The &lt;code&gt;schedule&lt;/code&gt; event can be delayed during periods of high loads of GitHub Actions workflow runs. High load times include the start of every hour. If the load is sufficiently high enough, some queued jobs may be dropped." (&lt;a href="https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#schedule" rel="noopener noreferrer"&gt;GitHub docs&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Only the default branch runs.&lt;/strong&gt; A schedule on any other branch does nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Five minutes is the shortest interval.&lt;/strong&gt; (&lt;a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onschedule" rel="noopener noreferrer"&gt;GitHub docs&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public repositories stop after 60 days without activity.&lt;/strong&gt; "In a public repository, scheduled workflows are automatically disabled when no repository activity has occurred in 60 days." (&lt;a href="https://docs.github.com/en/actions/how-tos/manage-workflow-runs/disable-and-enable-workflows" rel="noopener noreferrer"&gt;GitHub docs&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GitHub's documentation does not describe a retry or a catch-up run for a scheduled run that was dropped. Users also report schedules that stop entirely while &lt;code&gt;workflow_dispatch&lt;/code&gt; keeps working, for example &lt;a href="https://github.com/orgs/community/discussions/214540" rel="noopener noreferrer"&gt;#214540&lt;/a&gt;, &lt;a href="https://github.com/orgs/community/discussions/214648" rel="noopener noreferrer"&gt;#214648&lt;/a&gt; and &lt;a href="https://github.com/orgs/community/discussions/214650" rel="noopener noreferrer"&gt;#214650&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you stay on GitHub's scheduler, at least move the cron off minute &lt;code&gt;0&lt;/code&gt;. Something like &lt;code&gt;17 6 * * *&lt;/code&gt; avoids the start-of-hour load GitHub mentions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Add workflow_dispatch
&lt;/h2&gt;

&lt;p&gt;Add an empty &lt;code&gt;workflow_dispatch:&lt;/code&gt; next to the existing schedule. Keep &lt;code&gt;schedule:&lt;/code&gt; for now so nothing stops running before the new trigger works.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/report.yml
&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Nightly report&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;cron&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'0 6 * * *'&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo "Building the report"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commit it to the default branch. The dispatch event only works for workflow files that exist there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Create a token that can do one thing
&lt;/h2&gt;

&lt;p&gt;Create a fine-grained personal access token with as little access as possible:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In GitHub, open &lt;strong&gt;Settings&lt;/strong&gt;, then &lt;strong&gt;Developer settings&lt;/strong&gt;, then &lt;strong&gt;Personal access tokens&lt;/strong&gt;, then &lt;strong&gt;Fine-grained tokens&lt;/strong&gt;, and select &lt;strong&gt;Generate new token&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Pick an &lt;strong&gt;Expiration&lt;/strong&gt; date. A leaked token with an expiry stays useful for less time.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Resource owner&lt;/strong&gt;, pick the account or organization that owns the repository. If the organization requires approval, the token stays &lt;code&gt;pending&lt;/code&gt; until an admin approves it.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Repository access&lt;/strong&gt;, choose &lt;strong&gt;Only select repositories&lt;/strong&gt; and pick the one repository.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Permissions&lt;/strong&gt;, set &lt;strong&gt;Actions&lt;/strong&gt; to &lt;strong&gt;Read and write&lt;/strong&gt;. That is the only permission the dispatch endpoint needs.&lt;/li&gt;
&lt;li&gt;Generate it and keep it in &lt;code&gt;GITHUB_DISPATCH_TOKEN&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 3: Test the call once by hand
&lt;/h2&gt;

&lt;p&gt;Replace &lt;code&gt;OWNER&lt;/code&gt;, &lt;code&gt;REPO&lt;/code&gt; and &lt;code&gt;report.yml&lt;/code&gt; with your values, and &lt;code&gt;main&lt;/code&gt; if your default branch has another name. The path segment can be the workflow's file name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl --include --request POST \
  &lt;span class="s1"&gt;'https://api.github.com/repos/OWNER/REPO/actions/workflows/report.yml/dispatches'&lt;/span&gt; \
  --header &lt;span class="s2"&gt;"Authorization: Bearer $GITHUB_DISPATCH_TOKEN"&lt;/span&gt; \
  --header &lt;span class="s1"&gt;'Accept: application/vnd.github+json'&lt;/span&gt; \
  --data &lt;span class="s1"&gt;'{"ref":"main"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expect &lt;code&gt;204 No Content&lt;/code&gt; and a new run in the repository's &lt;strong&gt;Actions&lt;/strong&gt; tab. If you send &lt;code&gt;X-GitHub-Api-Version: 2026-03-10&lt;/code&gt;, the same call returns &lt;code&gt;200&lt;/code&gt; with the run ID instead. Without the header, GitHub uses &lt;code&gt;2022-11-28&lt;/code&gt; and returns &lt;code&gt;204&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If it fails:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;404&lt;/code&gt;: the owner, repository or workflow file name is wrong, or the token was created for a different repository.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;401&lt;/code&gt;: the token is wrong, expired or deleted.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;403&lt;/code&gt;: the token lacks &lt;strong&gt;Actions: Read and write&lt;/strong&gt;, or you are being rate limited.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;422&lt;/code&gt;: usually the workflow on the default branch has no &lt;code&gt;workflow_dispatch&lt;/code&gt; trigger yet, or &lt;code&gt;ref&lt;/code&gt; names a branch that does not exist.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Get this working before you schedule anything. A scheduler that retries will not fix a &lt;code&gt;4xx&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Send the call on a timer
&lt;/h2&gt;

&lt;p&gt;Anything that can send an authenticated &lt;code&gt;POST&lt;/code&gt; on a schedule works. Three options, from least to most setup on your side:&lt;/p&gt;

&lt;h3&gt;
  
  
  Option A: cron-job.org (free, no code)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://cron-job.org/en/" rel="noopener noreferrer"&gt;cron-job.org&lt;/a&gt; is a free, donation-funded cron service. Create a job with the dispatches URL and your schedule, then in the job's advanced settings set the method to &lt;code&gt;POST&lt;/code&gt;, add the &lt;code&gt;Authorization&lt;/code&gt; and &lt;code&gt;Accept&lt;/code&gt; headers from Step 3, and set the body to &lt;code&gt;{"ref":"main"}&lt;/code&gt;. It can run as often as every minute and notify you when a job fails. Its FAQ gives a 30-second timeout, the job history keeps the last 50 executions, and its documentation does not describe automatic retries.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option B: a Cloudflare Worker with a cron trigger
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://developers.cloudflare.com/workers/configuration/cron-triggers/" rel="noopener noreferrer"&gt;Cron Triggers&lt;/a&gt; run a Worker on a cron in UTC, and the Workers Free plan allows 5 of them per account. The token lives in a Worker secret.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# wrangler.toml
&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"report-dispatch"&lt;/span&gt;
&lt;span class="na"&gt;main&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"src/index.js"&lt;/span&gt;
&lt;span class="na"&gt;compatibility_date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"2026-11-01"&lt;/span&gt;

&lt;span class="k"&gt;[triggers]&lt;/span&gt;
&lt;span class="na"&gt;crons&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"0 6 * * *"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/index.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;DISPATCH_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="s2"&gt;"https://api.github.com/repos/OWNER/REPO/actions/workflows/report.yml/dispatches"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;scheduled&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;DISPATCH_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${env.GITHUB_DISPATCH_TOKEN}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nc"&gt;Accept&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"application/vnd.github+json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"User-Agent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"report-dispatch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"main"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`GitHub returned ${res.status}: ${await res.text()}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx wrangler secret put GITHUB_DISPATCH_TOKEN
npx wrangler deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub rejects API requests without a &lt;code&gt;User-Agent&lt;/code&gt;, so set one. Throwing on a non-2xx response marks the invocation as failed in the Worker's logs. Retries, if you want them, are your code's job.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option C: Stormedo (we build it)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://stormedo.com" rel="noopener noreferrer"&gt;Stormedo&lt;/a&gt; sends scheduled HTTP requests for you. A schedule sends the Step 3 request at each cron slot, retries with backoff when GitHub returns &lt;code&gt;5xx&lt;/code&gt; or &lt;code&gt;429&lt;/code&gt; or takes longer than 50 seconds, and keeps every attempt with its status code. Header values are stored but never shown back. You can set it up in the dashboard without code, or with the API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl --request POST &lt;span class="s1"&gt;'https://api.stormedo.com/schedules'&lt;/span&gt; \
  --header &lt;span class="s2"&gt;"Authorization: Bearer $STORMEDO_TOKEN"&lt;/span&gt; \
  --header &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  --header &lt;span class="s1"&gt;'Idempotency-Key: github-report-dispatch'&lt;/span&gt; \
  --data @- &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;EOF
&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"name"&lt;/span&gt;: &lt;span class="s2"&gt;"GitHub nightly report"&lt;/span&gt;,
  &lt;span class="s2"&gt;"timing"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"type"&lt;/span&gt;: &lt;span class="s2"&gt;"cron"&lt;/span&gt;, &lt;span class="s2"&gt;"expression"&lt;/span&gt;: &lt;span class="s2"&gt;"0 6 * * *"&lt;/span&gt;, &lt;span class="s2"&gt;"timezone"&lt;/span&gt;: &lt;span class="s2"&gt;"UTC"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;,
  &lt;span class="s2"&gt;"request"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"url"&lt;/span&gt;: &lt;span class="s2"&gt;"https://api.github.com/repos/OWNER/REPO/actions/workflows/report.yml/dispatches"&lt;/span&gt;,
    &lt;span class="s2"&gt;"headers"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;"Authorization"&lt;/span&gt;: &lt;span class="s2"&gt;"Bearer $GITHUB_DISPATCH_TOKEN"&lt;/span&gt;,
      &lt;span class="s2"&gt;"Accept"&lt;/span&gt;: &lt;span class="s2"&gt;"application/vnd.github+json"&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;,
    &lt;span class="s2"&gt;"body"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"ref"&lt;/span&gt;: &lt;span class="s2"&gt;"main"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The free plan includes 3 schedules and 30,000 requests a month, and a schedule every 5 minutes uses about 8,640. The &lt;a href="https://stormedo.com/guides/github-actions-schedule-workflow-dispatch/" rel="noopener noreferrer"&gt;full guide&lt;/a&gt; has the dashboard walkthrough with screenshots and JavaScript and Python examples.&lt;/p&gt;

&lt;h3&gt;
  
  
  Which one?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;One free call a day with no retries is enough: cron-job.org.&lt;/li&gt;
&lt;li&gt;You already run code on Cloudflare: a Worker keeps it in one place.&lt;/li&gt;
&lt;li&gt;You want retries on GitHub errors and a per-attempt log without writing code: Stormedo.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 5: Remove the schedule trigger
&lt;/h2&gt;

&lt;p&gt;Once the first external call has started a run, delete the &lt;code&gt;schedule:&lt;/code&gt; block. If both triggers stay, each slot can run twice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dispatched runs report &lt;code&gt;github.event_name&lt;/code&gt; as &lt;code&gt;workflow_dispatch&lt;/code&gt;, so update any step that checks for &lt;code&gt;schedule&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things to know whichever option you pick
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A &lt;code&gt;204&lt;/code&gt; means GitHub accepted the dispatch, not that the job passed.&lt;/strong&gt; The external scheduler never sees the run. Keep watching failed runs in GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A retry can start a second run.&lt;/strong&gt; If GitHub accepts a call but the response times out, a retry may dispatch the workflow again. Make the job safe to run twice, and add a concurrency group so two runs never overlap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;concurrency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nightly-report&lt;/span&gt;
  &lt;span class="na"&gt;cancel-in-progress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Rate limits can come back as &lt;code&gt;403&lt;/code&gt;.&lt;/strong&gt; GitHub signals rate limits with &lt;code&gt;403&lt;/code&gt; or &lt;code&gt;429&lt;/code&gt;. A call every 5 minutes is 12 an hour, far below the 5,000 an hour a personal access token gets, so a &lt;code&gt;403&lt;/code&gt; usually means a permission problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Workflow inputs go in the body.&lt;/strong&gt; If the workflow declares inputs, send them next to &lt;code&gt;ref&lt;/code&gt;. GitHub accepts up to 25 and uses defaults for the rest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"ref"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"inputs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"environment"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"production"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Match the timezone.&lt;/strong&gt; GitHub runs &lt;code&gt;schedule&lt;/code&gt; crons in UTC by default. Set your external scheduler to UTC too, or the job moves when you switch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Put the token's expiry in your calendar.&lt;/strong&gt; An expired token returns &lt;code&gt;401&lt;/code&gt; on every call, and no retry fixes that. Generate the new token, update the scheduler, then delete the old one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Missed runs are not backfilled.&lt;/strong&gt; If a job has to catch up after a gap (reports, syncs, cleanups), run it once by hand from the &lt;strong&gt;Actions&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;If your setup hits a case this does not cover, ask in the comments and we will add it.&lt;/p&gt;

</description>
      <category>githubactions</category>
      <category>devops</category>
      <category>automation</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
