quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.84k stars 394 forks source link

quinn connect h3 server timeout on windows #1707

Closed NightBalance closed 10 months ago

NightBalance commented 1 year ago

when I using the crate reqwest with example simple_h3 on windows, it was timeout, I enabled the trace log on quinn, the log show that Sending ClientHello Message, then nothing happened until timeout.

But on macOS, no problem happened.

djc commented 1 year ago

Do you have a firewall setup in your Windows environment?

NightBalance commented 1 year ago

Do you have a firewall setup in your Windows environment?

When disable all the firewall, this question still exists, please help

NightBalance commented 1 year ago

Do you have a firewall setup in your Windows environment?

When disable all the firewall, this question still exists, please help

Also, I fork the reqwest and update the quinn version and h3, h3-quinn, the problem not solved

djc commented 1 year ago

What server are you sending to? Can you show more trace log context around the "Sending ClientHello message"?

NightBalance commented 1 year ago

What server are you sending to? Can you show more trace log context around the "Sending ClientHello message"?

Thanks for reply, the command I'm using like this on macOS:

the server is https://cloudflare-quic.com

./h3_simple https://cloudflare-quic.com
Record { metadata: Metadata { level: Debug, target: "h3_simple" }, args: it works, module_path: Some(Static("h3_simple")), file: Some(Static("examples/h3_simple.rs")), line: Some(35) }

Fetching "https://cloudflare-quic.com"...
Record { metadata: Metadata { level: Trace, target: "reqwest::async_impl::h3_client" }, args: did not find connection ("https", cloudflare-quic.com) in pool so connecting..., module_path: Some(Static("reqwest::async_impl::h3_client")), file: Some(Static("src/async_impl/h3_client/mod.rs")), line: Some(41) }

Record { metadata: Metadata { level: Debug, target: "rustls::client::hs" }, args: No cached session for DnsName("cloudflare-quic.com"), module_path: Some(Static("rustls::client::hs")), file: Some(Static("/Users/earth/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.21.8/src/client/hs.rs")), line: Some(73) }

Record { metadata: Metadata { level: Debug, target: "rustls::client::hs" }, args: Not resuming any session, module_path: Some(Static("rustls::client::hs")), file: Some(Static("/Users/earth/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.21.8/src/client/hs.rs")), line: Some(132) }

Record { metadata: Metadata { level: Trace, target: "rustls::client::hs" }, args: Sending ClientHello Message {
    version: TLSv1_0,
    payload: Handshake {
        parsed: HandshakeMessagePayload {
            typ: ClientHello,
            payload: ClientHello(
                ClientHelloPayload {
                    client_version: TLSv1_2,
                    random: 5e1229f180b1a649ed50a2c8e3716d7d9ac5abf2079f84282420a38690560c0f,
                    session_id: ,
                    cipher_suites: [
                        TLS13_AES_256_GCM_SHA384,
                        TLS13_AES_128_GCM_SHA256,
                        TLS13_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
                    ],
                    compression_methods: [
                        Null,
                    ],
                    extensions: [
                        SupportedVersions(
                            [
                                TLSv1_3,
                            ],
                        ),
                        ECPointFormats(
                            [
                                Uncompressed,
                            ],
                        ),
                        NamedGroups(
                            [
                                X25519,
                                secp256r1,
                                secp384r1,
                            ],
                        ),
                        SignatureAlgorithms(
                            [
                                ECDSA_NISTP384_SHA384,
                                ECDSA_NISTP256_SHA256,
                                ED25519,
                                RSA_PSS_SHA512,
                                RSA_PSS_SHA384,
                                RSA_PSS_SHA256,
                                RSA_PKCS1_SHA512,
                                RSA_PKCS1_SHA384,
                                RSA_PKCS1_SHA256,
                            ],
                        ),
                        ExtendedMasterSecretRequest,
                        CertificateStatusRequest(
                            OCSP(
                                OCSPCertificateStatusRequest {
                                    responder_ids: [],
                                    extensions: ,
                                },
                            ),
                        ),
                        ServerName(
                            [
                                ServerName {
                                    typ: HostName,
                                    payload: HostName(
                                        DnsName(
                                            "cloudflare-quic.com",
                                        ),
                                    ),
                                },
                            ],
                        ),
                        SignedCertificateTimestampRequest,
                        KeyShare(
                            [
                                KeyShareEntry {
                                    group: X25519,
                                    payload: cfbac0417e77e1bba73d8249770161488e52f504f4b3b7a1e4341c34f24f0d2b,
                                },
                            ],
                        ),
                        PresharedKeyModes(
                            [
                                PSK_DHE_KE,
                            ],
                        ),
                        Protocols(
                            [
                                ProtocolName(
                                    6833,
                                ),
                            ],
                        ),
                        TransportParameters(
                            [
                                1,
                                2,
                                103,
                                16,
                                3,
                                2,
                                69,
                                192,
                                4,
                                8,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                5,
                                4,
                                128,
                                19,
                                18,
                                208,
                                6,
                                4,
                                128,
                                19,
                                18,
                                208,
                                7,
                                4,
                                128,
                                19,
                                18,
                                208,
                                8,
                                2,
                                64,
                                100,
                                9,
                                2,
                                64,
                                100,
                                14,
                                1,
                                5,
                                64,
                                182,
                                0,
                                32,
                                4,
                                128,
                                0,
                                255,
                                255,
                                15,
                                8,
                                4,
                                96,
                                118,
                                29,
                                232,
                                38,
                                60,
                                61,
                                106,
                                178,
                                0,
                            ],
                        ),
                        SessionTicket(
                            Request,
                        ),
                    ],
                },
            ),
        },
        encoded: 0100012103035e1229f180b1a649ed50a2c8e3716d7d9ac5abf2079f84282420a38690560c0f000014130213011303c02cc02bcca9c030c02fcca800ff010000e4002b0003020304000b00020100000a00080006001d00170018000d0014001205030403080708060805080406010501040100170000000500050100000000000000180016000013636c6f7564666c6172652d717569632e636f6d00120000003300260024001d0020cfbac0417e77e1bba73d8249770161488e52f504f4b3b7a1e4341c34f24f0d2b002d000201010010000500030268330039004501026710030245c00408ffffffffffffffff0504801312d00604801312d00704801312d008024064090240640e010540b60020048000ffff0f080460761de8263c3d6ab20000230000,
    },
}, module_path: Some(Static("rustls::client::hs")), file: Some(Static("/Users/earth/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.21.8/src/client/hs.rs")), line: Some(329) }

Record { metadata: Metadata { level: Trace, target: "rustls::client::hs" }, args: We got ServerHello ServerHelloPayload {
    legacy_version: TLSv1_2,
    random: 58ee71c533ee0b8efe32f9dacdac977a3b6d5480873a68a525997202a8421d37,
    session_id: ,
    cipher_suite: TLS13_AES_256_GCM_SHA384,
    compression_method: Null,
    extensions: [
        KeyShare(
            KeyShareEntry {
                group: X25519,
                payload: 82e93a7d78c4d509e7cfd51ba53df337c08e19751a199a729e08261bb1726936,
            },
        ),
        SupportedVersions(
            TLSv1_3,
        ),
    ],
}, module_path: Some(Static("rustls::client::hs")), file: Some(Static("/Users/earth/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.21.8/src/client/hs.rs")), line: Some(493) }

Record { metadata: Metadata { level: Debug, target: "rustls::client::hs" }, args: Using ciphersuite TLS13_AES_256_GCM_SHA384, module_path: Some(Static("rustls::client::hs")), file: Some(Static("/Users/earth/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.21.8/src/client/hs.rs")), line: Some(615) }

Record { metadata: Metadata { level: Debug, target: "rustls::client::tls13" }, args: Not resuming, module_path: Some(Static("rustls::client::tls13")), file: Some(Static("/Users/earth/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.21.8/src/client/tls13.rs")), line: Some(142) }

Record { metadata: Metadata { level: Trace, target: "rustls::client::client_conn" }, args: EarlyData rejected, module_path: Some(Static("rustls::client::client_conn")), file: Some(Static("/Users/earth/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.21.8/src/client/client_conn.rs")), line: Some(458) }

Record { metadata: Metadata { level: Debug, target: "rustls::client::tls13" }, args: TLS1.3 encrypted extensions: [ServerNameAck, Protocols([ProtocolName(6833)]), TransportParameters([0, 20, 126, 254, 156, 209, 14, 19, 169, 105, 197, 199, 103, 193, 14, 141, 241, 163, 117, 130, 111, 110, 1, 4, 128, 2, 191, 32, 3, 4, 128, 0, 255, 247, 4, 4, 128, 160, 0, 0, 6, 4, 128, 16, 0, 0, 7, 4, 128, 16, 0, 0, 8, 2, 64, 100, 9, 1, 3, 10, 1, 3, 11, 1, 25, 15, 20, 1, 15, 225, 238, 105, 81, 58, 1, 38, 13, 152, 238, 103, 81, 9, 65, 26, 154, 140, 133])], module_path: Some(Static("rustls::client::tls13")), file: Some(Static("/Users/earth/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.21.8/src/client/tls13.rs")), line: Some(381) }

Record { metadata: Metadata { level: Debug, target: "rustls::client::hs" }, args: ALPN protocol is Some(b"h3"), module_path: Some(Static("rustls::client::hs")), file: Some(Static("/Users/earth/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.21.8/src/client/hs.rs")), line: Some(472) }

Record { metadata: Metadata { level: Trace, target: "rustls::client::tls13" }, args: Server cert is [Certificate(b"0\x82\x05E0\x82\x04\xea\xa0\x03\x02\x01\x02\x02\x10\x01\xf2\x92<\xefX^--\xc9\x1d\x95K-\xb9L0\n\x06\x08*\x86H\xce=\x04\x03\x020J1\x0b0\t\x06\x03U\x04\x06\x13\x02US1\x190\x17\x06\x03U\x04\n\x13\x10Cloudflare, Inc.1 0\x1e\x06\x03U\x04\x03\x13\x17Cloudflare Inc ECC CA-30\x1e\x17\r230410000000Z\x17\r240409235959Z0u1\x0b0\t\x06\x03U\x04\x06\x13\x02US1\x130\x11\x06\x03U\x04\x08\x13\nCalifornia1\x160\x14\x06\x03U\x04\x07\x13\rSan Francisco1\x190\x17\x06\x03U\x04\n\x13\x10Cloudflare, Inc.1\x1e0\x1c\x06\x03U\x04\x03\x13\x15sni.cloudflaressl.com0Y0\x13\x06\x07*\x86H\xce=\x02\x01\x06\x08*\x86H\xce=\x03\x01\x07\x03B\0\x04b\xee\x8a\x1d\x96\x0e\xa30Q\xbakx\xd0s\x1b\xf6\xe9\xc4\x91:K\xdf/\x81\x89\xd4\x05#,\xa6\nZ\x90^l8\xdb1\x173\xec\x8b\xda\xc8\xd3\xdd%d\xc9\xcf\xe9j\x86d\xac\x97\xe5\xf1U7\x88\xedP\xde\xa3\x82\x03\x850\x82\x03\x810\x1f\x06\x03U\x1d#\x04\x180\x16\x80\x14\xa5\xce7\xea\xeb\xb0u\x0e\x94g\x88\xb4E\xfa\xd9$\x10\x87\x96\x1f0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\n\xaan\xa0~r\x8f\xbe\x82\x18\xeeK\xf1\x19`\x98%\0\xd2\xa10L\x06\x03U\x1d\x11\x04E0C\x82\x15sni.cloudflaressl.com\x82\x15*.cloudflare-quic.com\x82\x13cloudflare-quic.com0\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x07\x800\x1d\x06\x03U\x1d%\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020{\x06\x03U\x1d\x1f\x04t0r07\xa05\xa03\x861http://crl3.digicert.com/CloudflareIncECCCA-3.crl07\xa05\xa03\x861http://crl4.digicert.com/CloudflareIncECCCA-3.crl0>\x06\x03U\x1d \x0470503\x06\x06g\x81\x0c\x01\x02\x020)0'\x06\x08+\x06\x01\x05\x05\x07\x02\x01\x16\x1bhttp://www.digicert.com/CPS0v\x06\x08+\x06\x01\x05\x05\x07\x01\x01\x04j0h0$\x06\x08+\x06\x01\x05\x05\x070\x01\x86\x18http://ocsp.digicert.com0@\x06\x08+\x06\x01\x05\x05\x070\x02\x864http://cacerts.digicert.com/CloudflareIncECCCA-3.crt0\x0c\x06\x03U\x1d\x13\x01\x01\xff\x04\x020\00\x82\x01}\x06\n+\x06\x01\x04\x01\xd6y\x02\x04\x02\x04\x82\x01m\x04\x82\x01i\x01g\0v\0\xee\xcd\xd0d\xd5\xdb\x1a\xce\xc5\\\xb7\x9d\xb4\xcd\x13\xa22\x87F|\xbc\xec\xde\xc3QHYFq\x1f\xb5\x9b\0\0\x01\x87h\xd1rr\0\0\x04\x03\0G0E\x02 3.\xc6K\x0e\t\x12\xeb\x10\xa1\x0f\0\x7f@\xcb\x96\xa2\xcd\x7f \x89(\x9e\xde\xdc\xc2\xb3:\x9b\xa8M\x8f\x02!\0\xb6#\x13\xea\x80bw\x94\x9e\x87\x06C\x16\xa7BA6Q\0l\xa8\x85\xd9x#\xb9\x870xso\x03\0u\0s\xd9\x9e\x89\x1bL\x96x\xa0 }G\x9d\xe6\xb2\xc6\x1c\xd0Q^q\x19*\x8ck\x80\x10z\xc1wr\xb5\0\0\x01\x87h\xd1r\xb3\0\0\x04\x03\0F0D\x02 \x07\x10q\x8f\xd2\x94\x18\x0c\xa8\xb4\x9f*R\xcb\xfa\xe1\x15\xbbD\xef\x067;\x91c\x195\x9e\xe3U\xce\xdd\x02 x\xfb^#Z\x91\xb5S\xab7\xad\x11\x1c\xf3W\xa0-#\x1f*\x81\x1a\xdc\xba\x14\xc7G.\x12\xe5\x13L\0v\0H\xb0\xe3k\xda\xa6G4\x0f\xe5j\x02\xfa\x9d0\xeb\x1cR\x01\xcbV\xdd,\x81\xd9\xbb\xbf\xab9\xd8\x84s\0\0\x01\x87h\xd1r\x82\0\0\x04\x03\0G0E\x02 1\xa4\xd4\xc7\x04\xb6\xedq5\xd8j\xa0\xfesP\xa6\x8fl\x8d\x16\x1c\x9e\x14]\xef\x1cT\xe0\xcd>\xf81\x02!\0\x97$\x01\x9f\xebXi1hv\xc7v\xc1-\x17[%\xb7\x13\xa74}2\xf7\x81\xed\x8f\\q\x9e\x8d\xda0\n\x06\x08*\x86H\xce=\x04\x03\x02\x03I\00F\x02!\0\x848`\xe2ls*\x18\x0c\xf7\x82\xe8\xe2\xf3S\x01\x8d\xf3\x04\xe0\x0c\xff\t\xa6\x8b\xe9N\x18\xf1\x96%\t\x02!\0\xdad\xa3^$\x0f\xb1\xc1\0\x0c\r\x9f\x9d\x0e\x9c\x08`S\xf3KJ\x1eUit\xb5w\xbck\xcc\xadK"), Certificate(b"0\x82\x03\xcd0\x82\x02\xb5\xa0\x03\x02\x01\x02\x02\x10\n7\x87d^_\xb4\x8c\"N\xfd\x1b\xed\x14\x0c<0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\00Z1\x0b0\t\x06\x03U\x04\x06\x13\x02IE1\x120\x10\x06\x03U\x04\n\x13\tBaltimore1\x130\x11\x06\x03U\x04\x0b\x13\nCyberTrust1\"0 \x06\x03U\x04\x03\x13\x19Baltimore CyberTrust Root0\x1e\x17\r200127124808Z\x17\r241231235959Z0J1\x0b0\t\x06\x03U\x04\x06\x13\x02US1\x190\x17\x06\x03U\x04\n\x13\x10Cloudflare, Inc.1 0\x1e\x06\x03U\x04\x03\x13\x17Cloudflare Inc ECC CA-30Y0\x13\x06\x07*\x86H\xce=\x02\x01\x06\x08*\x86H\xce=\x03\x01\x07\x03B\0\x04\xb9\xadMf\x99\x14\x0bF\xec\x1f\x81\xd1*P\x1e\x9d\x03\x15/4\x12}-\x96\xb8\x888\x9b\x85_\x8f\xbf\xbbM\xefaF\xc4\xc9s\xd4$O\xe0\xee\x1c\xcel\xb3Qq/j\xeeL\x05\tw\xd3rb\xa4\x9b\xd7\xa3\x82\x01h0\x82\x01d0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xa5\xce7\xea\xeb\xb0u\x0e\x94g\x88\xb4E\xfa\xd9$\x10\x87\x96\x1f0\x1f\x06\x03U\x1d#\x04\x180\x16\x80\x14\xe5\x9dY0\x82GX\xcc\xac\xfa\x08T6\x86{:\xb5\x04M\xf00\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\x860\x1d\x06\x03U\x1d%\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020\x12\x06\x03U\x1d\x13\x01\x01\xff\x04\x080\x06\x01\x01\xff\x02\x01\004\x06\x08+\x06\x01\x05\x05\x07\x01\x01\x04(0&0$\x06\x08+\x06\x01\x05\x05\x070\x01\x86\x18http://ocsp.digicert.com0:\x06\x03U\x1d\x1f\x043010/\xa0-\xa0+\x86)http://crl3.digicert.com/Omniroot2025.crl0m\x06\x03U\x1d \x04f0d07\x06\t`\x86H\x01\x86\xfdl\x01\x010*0(\x06\x08+\x06\x01\x05\x05\x07\x02\x01\x16\x1chttps://www.digicert.com/CPS0\x0b\x06\t`\x86H\x01\x86\xfdl\x01\x020\x08\x06\x06g\x81\x0c\x01\x02\x010\x08\x06\x06g\x81\x0c\x01\x02\x020\x08\x06\x06g\x81\x0c\x01\x02\x030\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\0\x03\x82\x01\x01\0\x05$\x1d\xdd\x1b\xb0*\xeb\x98\xd6\x85\xe39M^kW\x9d\x82W\xfc\xeb\xe81\xa2W\x90e\x05\xbe\x16D8Zw\x02\xb9\xcf\x10B\xc6\xe1\x92\xa4\xe3E'\xf8\0G,h\xa8V\x99ST\x8f\xad\x9e@\xc1\xd0\x0f\xb6\xd7\r\x0b8HlP,I\x90\x06[d\x1d\x8b\xccH0.\xde\x08\xe2\x9bI\"\xc0\x92\x0c\x11^\x96\x92\x94\xd5\xfc \xdcVl\xe5\x92\x93\xbfz\x1c\xc07\xe3\x85I\x15\xfa+\xe1t9\x18\x0f\xb7\xda\xf3\xa2WX`O\xcc\x8e\x94\0\xfcF{41>MG\x82\x81:\xcb\xf4\x89]\x0e\xefM\rn\x9c\x1b\x82$\xdd2%]\x11xQ\x10=\xa05#\x04/eo\x9c\xc1\xd1C\xd7\xd0\x1e\xf31gY'\xddk\xd2u\t\x93\x11$$\x14\xcf)\xbe\xe6#\xc3\xb8\x8fr?\xe9\x07\xc8$DSz\xb3\xb9ae\xa1L\x0e\xc6H\0\xc9uc\x05\x87pER\x83\xd3\x95\x9dE\xea\xf0\xe81\x1d~\t\x1f\n\xfe>\xdd\xaa<^t\xd2\xac\xb1")], module_path: Some(Static("rustls::client::tls13")), file: Some(Static("/Users/earth/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.21.8/src/client/tls13.rs")), line: Some(679) }

Record { metadata: Metadata { level: Trace, target: "rustls::verify" }, args: Unvalidated OCSP response: [48, 130, 1, 19, 10, 1, 0, 160, 130, 1, 12, 48, 130, 1, 8, 6, 9, 43, 6, 1, 5, 5, 7, 48, 1, 1, 4, 129, 250, 48, 129, 247, 48, 129, 158, 162, 22, 4, 20, 165, 206, 55, 234, 235, 176, 117, 14, 148, 103, 136, 180, 69, 250, 217, 36, 16, 135, 150, 31, 24, 15, 50, 48, 50, 51, 49, 49, 48, 52, 48, 55, 51, 48, 51, 54, 90, 48, 115, 48, 113, 48, 73, 48, 9, 6, 5, 43, 14, 3, 2, 26, 5, 0, 4, 20, 18, 215, 139, 64, 44, 53, 98, 6, 250, 130, 127, 142, 216, 146, 36, 17, 180, 172, 245, 4, 4, 20, 165, 206, 55, 234, 235, 176, 117, 14, 148, 103, 136, 180, 69, 250, 217, 36, 16, 135, 150, 31, 2, 16, 1, 242, 146, 60, 239, 88, 94, 45, 45, 201, 29, 149, 75, 45, 185, 76, 128, 0, 24, 15, 50, 48, 50, 51, 49, 49, 48, 52, 48, 55, 49, 53, 48, 49, 90, 160, 17, 24, 15, 50, 48, 50, 51, 49, 49, 49, 49, 48, 54, 49, 53, 48, 49, 90, 48, 10, 6, 8, 42, 134, 72, 206, 61, 4, 3, 2, 3, 72, 0, 48, 69, 2, 32, 104, 49, 2, 193, 233, 134, 178, 5, 71, 4, 32, 17, 6, 75, 163, 219, 211, 54, 246, 105, 185, 149, 90, 230, 165, 15, 147, 120, 84, 57, 24, 31, 2, 33, 0, 162, 255, 65, 178, 14, 88, 129, 93, 147, 41, 173, 253, 10, 134, 52, 192, 192, 209, 14, 80, 200, 94, 189, 234, 181, 47, 70, 170, 206, 24, 119, 198], module_path: Some(Static("rustls::verify")), file: Some(Static("/Users/earth/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.21.8/src/verify.rs")), line: Some(410) }

Response: HTTP/3.0 200 OK
Headers: {
    "date": "Wed, 08 Nov 2023 14:09:02 GMT",
    "content-type": "text/html",
    "content-length": "125959",
    "server": "cloudflare",
    "cf-ray": "822e6433dad64044-SIN",
    "alt-svc": "h3=\":443\"; ma=86400",
}

It's the right result on macOS above,

on Windows, it shows below:

.\simple_h3.exe https://cloudflare-quic.com
Record { metadata: Metadata { level: Debug, target: "simple_h3" }, args: it works, module_path: Some(Static("simple_h3")), file: Some(Static("examples/simple_h3.rs")), line: Some(37) }
Fetching "https://cloudflare-quic.com"...
Record { metadata: Metadata { level: Trace, target: "reqwest::async_impl::h3_client" }, args: did not find connection ("https", cloudflare-quic.com) in pool so connecting..., module_path: Some(Static("reqwest::async_impl::h3_client")), file: Some(Static("src\\async_impl\\h3_client\\mod.rs")), line: Some(41) }
Record { metadata: Metadata { level: Debug, target: "rustls::client::hs" }, args: No cached session for DnsName("cloudflare-quic.com"), module_path: Some(Static("rustls::client::hs")), file: Some(Static("C:\\Users\\Night\\.cargo\\registry\\src\\rsproxy.cn-0dccff568467c15b\\rustls-0.21.8\\src\\client\\hs.rs")), line: Some(73) }
Record { metadata: Metadata { level: Debug, target: "rustls::client::hs" }, args: Not resuming any session, module_path: Some(Static("rustls::client::hs")), file: Some(Static("C:\\Users\\Night\\.cargo\\registry\\src\\rsproxy.cn-0dccff568467c15b\\rustls-0.21.8\\src\\client\\hs.rs")), line: Some(132) }
Record { metadata: Metadata { level: Trace, target: "rustls::client::hs" }, args: Sending ClientHello Message {
    version: TLSv1_0,
    payload: Handshake {
        parsed: HandshakeMessagePayload {
            typ: ClientHello,
            payload: ClientHello(
                ClientHelloPayload {
                    client_version: TLSv1_2,
                    random: 0285b2c85971c7028ed1e62febfcf80f5f790f9ea93b5620734012f16d1a1a5b,
                    session_id: ,
                    cipher_suites: [
                        TLS13_AES_256_GCM_SHA384,
                        TLS13_AES_128_GCM_SHA256,
                        TLS13_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
                    ],
                    compression_methods: [
                        Null,
                    ],
                    extensions: [
                        SupportedVersions(
                            [
                                TLSv1_3,
                            ],
                        ),
                        ECPointFormats(
                            [
                                Uncompressed,
                            ],
                        ),
                        NamedGroups(
                            [
                                X25519,
                                secp256r1,
                                secp384r1,
                            ],
                        ),
                        SignatureAlgorithms(
                            [
                                ECDSA_NISTP384_SHA384,
                                ECDSA_NISTP256_SHA256,
                                ED25519,
                                RSA_PSS_SHA512,
                                RSA_PSS_SHA384,
                                RSA_PSS_SHA256,
                                RSA_PKCS1_SHA512,
                                RSA_PKCS1_SHA384,
                                RSA_PKCS1_SHA256,
                            ],
                        ),
                        ExtendedMasterSecretRequest,
                        CertificateStatusRequest(
                            OCSP(
                                OCSPCertificateStatusRequest {
                                    responder_ids: [],
                                    extensions: ,
                                },
                            ),
                        ),
                        ServerName(
                            [
                                ServerName {
                                    typ: HostName,
                                    payload: HostName(
                                        DnsName(
                                            "cloudflare-quic.com",
                                        ),
                                    ),
                                },
                            ],
                        ),
                        SignedCertificateTimestampRequest,
                        KeyShare(
                            [
                                KeyShareEntry {
                                    group: X25519,
                                    payload: 18d4e1aafaf9f54e6c86259f0ee047e638b63c9a58788b4b1090a56da0148a4e,
                                },
                            ],
                        ),
                        PresharedKeyModes(
                            [
                                PSK_DHE_KE,
                            ],
                        ),
                        Protocols(
                            [
                                ProtocolName(
                                    6833,
                                ),
                            ],
                        ),
                        TransportParameters(
                            [
                                1,
                                2,
                                103,
                                16,
                                3,
                                2,
                                69,
                                192,
                                4,
                                8,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                5,
                                4,
                                128,
                                19,
                                18,
                                208,
                                6,
                                4,
                                128,
                                19,
                                18,
                                208,
                                7,
                                4,
                                128,
                                19,
                                18,
                                208,
                                8,
                                2,
                                64,
                                100,
                                9,
                                2,
                                64,
                                100,
                                14,
                                1,
                                5,
                                64,
                                182,
                                0,
                                32,
                                4,
                                128,
                                0,
                                255,
                                255,
                                15,
                                8,
                                248,
                                139,
                                26,
                                107,
                                163,
                                75,
                                134,
                                179,
                                106,
                                178,
                                0,
                            ],
                        ),
                        SessionTicket(
                            Request,
                        ),
                    ],
                },
            ),
        },
        encoded: 0100012103030285b2c85971c7028ed1e62febfcf80f5f790f9ea93b5620734012f16d1a1a5b000014130213011303c02cc02bcca9c030c02fcca800ff010000e4002b0003020304000b00020100000a00080006001d00170018000d0014001205030403080708060805080406010501040100170000000500050100000000000000180016000013636c6f7564666c6172652d717569632e636f6d00120000003300260024001d002018d4e1aafaf9f54e6c86259f0ee047e638b63c9a58788b4b1090a56da0148a4e002d000201010010000500030268330039004501026710030245c00408ffffffffffffffff0504801312d00604801312d00704801312d008024064090240640e010540b60020048000ffff0f08f88b1a6ba34b86b36ab20000230000,
    },
}, module_path: Some(Static("rustls::client::hs")), file: Some(Static("C:\\Users\\Night\\.cargo\\registry\\src\\rsproxy.cn-0dccff568467c15b\\rustls-0.21.8\\src\\client\\hs.rs")), line: Some(329) }
Record { metadata: Metadata { level: Debug, target: "rustls::client::hs" }, args: No cached session for DnsName("cloudflare-quic.com"), module_path: Some(Static("rustls::client::hs")), file: Some(Static("C:\\Users\\Night\\.cargo\\registry\\src\\rsproxy.cn-0dccff568467c15b\\rustls-0.21.8\\src\\client\\hs.rs")), line: Some(73) }
Record { metadata: Metadata { level: Debug, target: "rustls::client::hs" }, args: Not resuming any session, module_path: Some(Static("rustls::client::hs")), file: Some(Static("C:\\Users\\Night\\.cargo\\registry\\src\\rsproxy.cn-0dccff568467c15b\\rustls-0.21.8\\src\\client\\hs.rs")), line: Some(132) }
Record { metadata: Metadata { level: Trace, target: "rustls::client::hs" }, args: Sending ClientHello Message {
    version: TLSv1_0,
    payload: Handshake {
        parsed: HandshakeMessagePayload {
            typ: ClientHello,
            payload: ClientHello(
                ClientHelloPayload {
                    client_version: TLSv1_2,
                    random: 778fec6befa1de798f2f1bb3ed3077d1bbf365b53698f5396387d327a9e03d45,
                    session_id: ,
                    cipher_suites: [
                        TLS13_AES_256_GCM_SHA384,
                        TLS13_AES_128_GCM_SHA256,
                        TLS13_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
                    ],
                    compression_methods: [
                        Null,
                    ],
                    extensions: [
                        SupportedVersions(
                            [
                                TLSv1_3,
                            ],
                        ),
                        ECPointFormats(
                            [
                                Uncompressed,
                            ],
                        ),
                        NamedGroups(
                            [
                                X25519,
                                secp256r1,
                                secp384r1,
                            ],
                        ),
                        SignatureAlgorithms(
                            [
                                ECDSA_NISTP384_SHA384,
                                ECDSA_NISTP256_SHA256,
                                ED25519,
                                RSA_PSS_SHA512,
                                RSA_PSS_SHA384,
                                RSA_PSS_SHA256,
                                RSA_PKCS1_SHA512,
                                RSA_PKCS1_SHA384,
                                RSA_PKCS1_SHA256,
                            ],
                        ),
                        ExtendedMasterSecretRequest,
                        CertificateStatusRequest(
                            OCSP(
                                OCSPCertificateStatusRequest {
                                    responder_ids: [],
                                    extensions: ,
                                },
                            ),
                        ),
                        ServerName(
                            [
                                ServerName {
                                    typ: HostName,
                                    payload: HostName(
                                        DnsName(
                                            "cloudflare-quic.com",
                                        ),
                                    ),
                                },
                            ],
                        ),
                        SignedCertificateTimestampRequest,
                        KeyShare(
                            [
                                KeyShareEntry {
                                    group: X25519,
                                    payload: b51eb92bffd989a188fa5c4b4699270bf8140639667cca6a7cc26b2c7d436d4a,
                                },
                            ],
                        ),
                        PresharedKeyModes(
                            [
                                PSK_DHE_KE,
                            ],
                        ),
                        Protocols(
                            [
                                ProtocolName(
                                    6833,
                                ),
                            ],
                        ),
                        TransportParameters(
                            [
                                1,
                                2,
                                103,
                                16,
                                3,
                                2,
                                69,
                                192,
                                4,
                                8,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                5,
                                4,
                                128,
                                19,
                                18,
                                208,
                                6,
                                4,
                                128,
                                19,
                                18,
                                208,
                                7,
                                4,
                                128,
                                19,
                                18,
                                208,
                                8,
                                2,
                                64,
                                100,
                                9,
                                2,
                                64,
                                100,
                                14,
                                1,
                                5,
                                64,
                                182,
                                0,
                                32,
                                4,
                                128,
                                0,
                                255,
                                255,
                                15,
                                8,
                                123,
                                244,
                                1,
                                38,
                                190,
                                221,
                                74,
                                214,
                                106,
                                178,
                                0,
                            ],
                        ),
                        SessionTicket(
                            Request,
                        ),
                    ],
                },
            ),
        },
        encoded: 010001210303778fec6befa1de798f2f1bb3ed3077d1bbf365b53698f5396387d327a9e03d45000014130213011303c02cc02bcca9c030c02fcca800ff010000e4002b0003020304000b00020100000a00080006001d00170018000d0014001205030403080708060805080406010501040100170000000500050100000000000000180016000013636c6f7564666c6172652d717569632e636f6d00120000003300260024001d0020b51eb92bffd989a188fa5c4b4699270bf8140639667cca6a7cc26b2c7d436d4a002d000201010010000500030268330039004501026710030245c00408ffffffffffffffff0504801312d00604801312d00704801312d008024064090240640e010540b60020048000ffff0f087bf40126bedd4ad66ab20000230000,
    },
}, module_path: Some(Static("rustls::client::hs")), file: Some(Static("C:\\Users\\Night\\.cargo\\registry\\src\\rsproxy.cn-0dccff568467c15b\\rustls-0.21.8\\src\\client\\hs.rs")), line: Some(329) }
Record { metadata: Metadata { level: Debug, target: "rustls::client::hs" }, args: No cached session for DnsName("cloudflare-quic.com"), module_path: Some(Static("rustls::client::hs")), file: Some(Static("C:\\Users\\Night\\.cargo\\registry\\src\\rsproxy.cn-0dccff568467c15b\\rustls-0.21.8\\src\\client\\hs.rs")), line: Some(73) }
Record { metadata: Metadata { level: Debug, target: "rustls::client::hs" }, args: Not resuming any session, module_path: Some(Static("rustls::client::hs")), file: Some(Static("C:\\Users\\Night\\.cargo\\registry\\src\\rsproxy.cn-0dccff568467c15b\\rustls-0.21.8\\src\\client\\hs.rs")), line: Some(132) }
Record { metadata: Metadata { level: Trace, target: "rustls::client::hs" }, args: Sending ClientHello Message {
    version: TLSv1_0,
    payload: Handshake {
        parsed: HandshakeMessagePayload {
            typ: ClientHello,
            payload: ClientHello(
                ClientHelloPayload {
                    client_version: TLSv1_2,
                    random: 9faaf314e20c0f5b942f6988df9f196fbf8f41ab71a14a2aec73bfd3d6beb3c6,
                    session_id: ,
                    cipher_suites: [
                        TLS13_AES_256_GCM_SHA384,
                        TLS13_AES_128_GCM_SHA256,
                        TLS13_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
                    ],
                    compression_methods: [
                        Null,
                    ],
                    extensions: [
                        SupportedVersions(
                            [
                                TLSv1_3,
                            ],
                        ),
                        ECPointFormats(
                            [
                                Uncompressed,
                            ],
                        ),
                        NamedGroups(
                            [
                                X25519,
                                secp256r1,
                                secp384r1,
                            ],
                        ),
                        SignatureAlgorithms(
                            [
                                ECDSA_NISTP384_SHA384,
                                ECDSA_NISTP256_SHA256,
                                ED25519,
                                RSA_PSS_SHA512,
                                RSA_PSS_SHA384,
                                RSA_PSS_SHA256,
                                RSA_PKCS1_SHA512,
                                RSA_PKCS1_SHA384,
                                RSA_PKCS1_SHA256,
                            ],
                        ),
                        ExtendedMasterSecretRequest,
                        CertificateStatusRequest(
                            OCSP(
                                OCSPCertificateStatusRequest {
                                    responder_ids: [],
                                    extensions: ,
                                },
                            ),
                        ),
                        ServerName(
                            [
                                ServerName {
                                    typ: HostName,
                                    payload: HostName(
                                        DnsName(
                                            "cloudflare-quic.com",
                                        ),
                                    ),
                                },
                            ],
                        ),
                        SignedCertificateTimestampRequest,
                        KeyShare(
                            [
                                KeyShareEntry {
                                    group: X25519,
                                    payload: 326cf4cb3bcb2b4a14635fa08aa04d4a98ac329b37ab3c867a77a7d9b401b335,
                                },
                            ],
                        ),
                        PresharedKeyModes(
                            [
                                PSK_DHE_KE,
                            ],
                        ),
                        Protocols(
                            [
                                ProtocolName(
                                    6833,
                                ),
                            ],
                        ),
                        TransportParameters(
                            [
                                1,
                                2,
                                103,
                                16,
                                3,
                                2,
                                69,
                                192,
                                4,
                                8,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                255,
                                5,
                                4,
                                128,
                                19,
                                18,
                                208,
                                6,
                                4,
                                128,
                                19,
                                18,
                                208,
                                7,
                                4,
                                128,
                                19,
                                18,
                                208,
                                8,
                                2,
                                64,
                                100,
                                9,
                                2,
                                64,
                                100,
                                14,
                                1,
                                5,
                                64,
                                182,
                                0,
                                32,
                                4,
                                128,
                                0,
                                255,
                                255,
                                15,
                                8,
                                87,
                                55,
                                239,
                                215,
                                72,
                                8,
                                159,
                                55,
                                106,
                                178,
                                0,
                            ],
                        ),
                        SessionTicket(
                            Request,
                        ),
                    ],
                },
            ),
        },
        encoded: 0100012103039faaf314e20c0f5b942f6988df9f196fbf8f41ab71a14a2aec73bfd3d6beb3c6000014130213011303c02cc02bcca9c030c02fcca800ff010000e4002b0003020304000b00020100000a00080006001d00170018000d0014001205030403080708060805080406010501040100170000000500050100000000000000180016000013636c6f7564666c6172652d717569632e636f6d00120000003300260024001d0020326cf4cb3bcb2b4a14635fa08aa04d4a98ac329b37ab3c867a77a7d9b401b335002d000201010010000500030268330039004501026710030245c00408ffffffffffffffff0504801312d00604801312d00704801312d008024064090240640e010540b60020048000ffff0f085737efd748089f376ab20000230000,
    },
}, module_path: Some(Static("rustls::client::hs")), file: Some(Static("C:\\Users\\Night\\.cargo\\registry\\src\\rsproxy.cn-0dccff568467c15b\\rustls-0.21.8\\src\\client\\hs.rs")), line: Some(329) }
Error: reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("cloudflare-quic.com")), port: None, path: "/", query: None, fragment: None }, source: reqwest::Error { kind: Request, source: TimedOut } }

on Windows, the Sending ClientHello Message log 3 times, then timeout, many thanks

on macOS, it response

Response: HTTP/3.0 200 OK
Headers: {
    "date": "Wed, 08 Nov 2023 14:09:02 GMT",
    "content-type": "text/html",
    "content-length": "125959",
    "server": "cloudflare",
    "cf-ray": "822e6433dad64044-SIN",
    "alt-svc": "h3=\":443\"; ma=86400",
}
djc commented 1 year ago

I mean, that looks like a socket-level timeout. Can you verify that you can send a UDP package on your Windows machine?

NightBalance commented 1 year ago

I mean, that looks like a socket-level timeout. Can you verify that you can send a UDP package on your Windows machine?

Yes, I aggree with you, on other windows machine, it has the same problem,

and my partner use https://github.com/cloudflare/quiche on his windows machine can success receive response,

but using reqwest h3_simple can not obtain the response,

His mathine also has other IM applications that using UDP packet to send receive message,

throuth the app wireshark can find the UDP proto

NightBalance commented 1 year ago

I mean, that looks like a socket-level timeout. Can you verify that you can send a UDP package on your Windows machine?

Yes, I aggree with you, on other windows machine, it has the same problem,

and my partner use https://github.com/cloudflare/quiche on his windows machine can success receive response,

but using reqwest h3_simple can not obtain the response,

His mathine also has other IM applications that using UDP packet to send receive message,

throuth the app wireshark can find the UDP proto

So I think there is some difference between macOS and windows on the UDP send framework,

or with different system api, but I'm not expert within it

djc commented 1 year ago

It would be interesting to minimize the difference between quiche and the h3 stack to see what might be going on, but I don't think I will have time to dig into that.

NightBalance commented 1 year ago

It would be interesting to minimize the difference between quiche and the h3 stack to see what might be going on, but I don't think I will have time to dig into that.

Yes, I just want to prove that sending UDP packets is OK on the machine,

But I don’t know much about UDP development on Windows.

NightBalance commented 1 year ago

So Maybe some time I will try to debug this code on quinn-udp crate

    pub fn send(
        &self,
        socket: UdpSockRef<'_>,
        _state: &UdpState,
        transmits: &[Transmit],
    ) -> Result<usize, io::Error> {
        let mut sent = 0;
        for transmit in transmits {
            match socket.0.send_to(
                &transmit.contents,
                &socket2::SockAddr::from(transmit.destination),
            ) {
                Ok(_) => {
                    sent += 1;
                }
                // We need to report that some packets were sent in this case, so we rely on
                // errors being either harmlessly transient (in the case of WouldBlock) or
                // recurring on the next call.
                Err(_) if sent != 0 => return Ok(sent),
                Err(e) => {
                    if e.kind() == io::ErrorKind::WouldBlock {
                        return Err(e);
                    }

                    // Other errors are ignored, since they will ususally be handled
                    // by higher level retransmits and timeouts.
                    log_sendmsg_error(&self.last_send_error, e, transmit);
                    sent += 1;
                }
            }
        }
        Ok(sent)
    }
djc commented 1 year ago

Maybe consider jumping in on #1701, @stormshield-damiend might have some good suggestions too.

NightBalance commented 1 year ago

Maybe consider jumping in on #1701, @stormshield-damiend might have some good suggestions too.

Yes, thanks for mention this link,

Today I try to cherry-pick this commit, but It has many difference between the release branch,

My ability can not solve the conflict for success compile,

Although I don't know if this will solve the problem

I hope the author can merge this #1701,

then may be solve this,

Also, I compiled the fallback mod, comment the windows mod in crate quinn-udp with cfg target windows,

they have the same phenomenon

and thanks for your attention to this issue ❤️

Ralith commented 1 year ago

I mean, that looks like a socket-level timeout

Actually, I think this is just reqwest giving up and/or propagating a QUIC-layer timeout.

@NightBalance, can you share quinn trace logs? The logs you shared look like they mostly involve rustls, and are certainly not from quinn. Please also format them in a conventional way, e.g. using the tracing fmt subscirber.

NightBalance commented 1 year ago

I mean, that looks like a socket-level timeout

Actually, I think this is just reqwest giving up and/or propagating a QUIC-layer timeout.

@NightBalance, can you share quinn trace logs? The logs you shared look like they mostly involve rustls, and are certainly not from quinn. Please also format them in a conventional way, e.g. using the tracing fmt subscirber.

Yes, I comfirm again, the log is not from the quinn crate, I may try to find out enable log from the quinn

NightBalance commented 1 year ago

Maybe consider jumping in on #1701, @stormshield-damiend might have some good suggestions too.

I changed the dependency quinn from h3 crate that including the #1701 commit,

then cargo update the reqwest with replaced h3, h3-quinn, quinn, it now include the #1701 ,

but the problem seems to still exist

Skyxim commented 11 months ago

Maybe it's a problem with me. https://github.com/seanmonstar/reqwest/issues/2058 If you listen on [::]:0 you will not receive a reply to an IPv4 request. However, for dual stack support, [::]:0 is generally used as the default value.

Ralith commented 10 months ago

Closing for lack of response. If anyone's having connectivity issues on Windows, feel free to open a new issue, including Quinn logs.