Re: Error from OpenSSL after a while
Pietro Cerutti via Chicken-users <[email protected]>
| Newsgroups | gmane.lisp.scheme.chicken |
|---|---|
| Message-ID | <01070197e66efa9a-cf1af1b1-a7a7-4f42-8ec2-d9daa1b94adb-000000@eu-central-1.amazonses.com> |
On Jul 07 2025, 19:45 +0000, Kristian Lein-Mathisen via Chicken-users <[email protected]> wrote: [-- Type: text/plain; charset=UTF-8, Encoding: quoted-printable, Size: 4.2K --] >Hi Pietro, > >I would still very mich recommend you test against local servers. That >would allow you to exclude the possibilities of Internet/ISP/Cloud-related >problems, before start to dive into the internals of Chicken. Yep, testing against a local server is a good idea, I'm gonna do that, thanks! > If you try against a local server you won't need any thread-sleep! > calls and you can hopefully (not?) reproduce the problem much faster. This is assuming the issue is network-related, which I doubt. But let me get back to the last after I've tried locally. Pietro > >K. > >On Mon, Jul 7, 2025 at 9:40 PM Pietro Cerutti <[email protected]> wrote: > >> On Jul 07 2025, 19:14 +0000, Anton Idukov <[email protected]> wrote: >> [-- Type: text/plain; charset=UTF-8, Encoding: quoted-printable, Size: >> 3.0K --] >> >1) net split, connection problems, firewall. Insert some sleep in between >> >requests. >> > >> >2) TLS may end handshake in case client-server time delta. Maybe client >> >local time drifting from actual UTC+tmzone? >> >> Thanks, but it doesn't look like it's related to any of that, to me. >> >> > >> >пн, 7 июл. 2025 г., 21:28 Kristian Lein-Mathisen via Chicken-users < >> >[email protected]>: >> > >> >> >> >> I'm unable to reproduce this. I replaced (read) with (thread-sleep! 1) >> and >> >> after 100s I C-c'd. Could this be the google servers that's banning >> your IP >> >> quicker than mine, and quickly shutting down the TCP connection? I don't >> >> know what else could be causing this. Perhaps you could try with a local >> >> https service. >> >> >> >> ==== >> >> $ chicken-status -list|grep ssl >> >> (openssl "2.2.6") >> >> >> >> On Mon, Jul 7, 2025, 15:57 Pietro Cerutti via Chicken-users < >> >> [email protected]> wrote: >> >> >> >>> I've been chasing this for months. I have a long-running process that >> >>> sometimes needs to do an HTTPS call. The call sometimes fails with an >> >>> error out of OpenSSL. >> >>> >> >>> Here's the code: >> >>> >> >>> --------------------------------------------------------------------- >> >>> (import >> >>> (scheme) >> >>> (openssl) >> >>> (only (chicken base) cut) >> >>> (only (chicken condition) condition->list handle-exceptions) >> >>> (only (chicken format) printf) >> >>> (only (chicken io) read-string) >> >>> (only (chicken time) current-seconds) >> >>> (only (chicken time posix) seconds->string) >> >>> (only (http-client) call-with-input-request)) >> >>> >> >>> >> >>> (define (dd . msg) >> >>> (printf "~A - ~A~%" (seconds->string (current-seconds)) msg)) >> >>> >> >>> (let loop () >> >>> (read) >> >>> (handle-exceptions exn >> >>> (begin >> >>> (dd "call failed" (condition->list exn))) >> >>> (begin >> >>> (dd "call start") >> >>> (call-with-input-request >> >>> "https://google.com" >> >>> #f >> >>> (lambda (in) >> >>> (dd (string-length (read-string #f in))))) >> >>> (dd "call end"))) >> >>> (loop)) >> >>> --------------------------------------------------------------------- >> >>> >> >>> And here's what I get after triggering the fetch a few time: >> >>> >> >>> $ chicken-csi -s openssl-error.scm >> >>> foo >> >>> Mon Jul 7 11:53:36 2025 - (call start) >> >>> Mon Jul 7 11:53:36 2025 - (17789) >> >>> Mon Jul 7 11:53:36 2025 - (call end) >> >>> foo >> >>> Mon Jul 7 11:53:41 2025 - (call start) >> >>> Mon Jul 7 11:53:41 2025 - (34456) >> >>> Mon Jul 7 11:53:41 2025 - (call end) >> >>> foo >> >>> Mon Jul 7 11:56:24 2025 - (call start) >> >>> Mon Jul 7 11:56:24 2025 - (34456) >> >>> Mon Jul 7 11:56:24 2025 - (call end) >> >>> foo >> >>> Mon Jul 7 13:31:49 2025 - (call start) >> >>> Mon Jul 7 13:31:49 2025 - (call failed ((exn message >> error:0A000197:SSL >> >>> routines::shutdown while in init location ssl-shutdown arguments ()) >> (i/o) >> >>> (net) (openssl status ssl))) >> >>> --------------------------------------------------------------------- >> >>> >> >>> Can people reproduce it? Do people have any clue? >> >>> >> >>> Thanks! >> >>> >> >>> -- >> >>> Pietro Cerutti >> >>> I have pledged to give 10% of income to effective charities >> >>> and invite you to join me - https://givingwhatwecan.org >> >>> >> >>> >> >> [-- Alternative Type #1: text/html; charset=UTF-8, Encoding: >> quoted-printable, Size: 4.6K --] >> >> -- >> Pietro Cerutti >> I have pledged to give 10% of income to effective charities >> and invite you to join me - https://givingwhatwecan.org >> [-- Alternative Type #1: text/html; charset=UTF-8, Encoding: quoted-printable, Size: 6.4K --] -- Pietro Cerutti I have pledged to give 10% of income to effective charities and invite you to join me - https://givingwhatwecan.org