From e1d146d6b04c434a7ebc5b381771609863f9c2a5 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 20 Apr 2026 16:10:33 +0200 Subject: [PATCH] - Fix test with https zone for libressl. --- doc/Changelog | 1 + testcode/petal.c | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 66b2fdddb..c0c54759c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 20 April 2026: Wouter - Fix compile warnings for thread setname routine, and test compile. - Fix unused variable warning when compiled without ssl. + - Fix test with https zone for libressl. 17 April 2026: Wouter - Fix setup of ssl context copy of the tls service pem option, diff --git a/testcode/petal.c b/testcode/petal.c index d7d7e07cc..ec99a092d 100644 --- a/testcode/petal.c +++ b/testcode/petal.c @@ -160,11 +160,26 @@ read_ssl_line(SSL* ssl, char* buf, size_t len) return 0; } if((r = SSL_read(ssl, buf+n, 1)) <= 0) { - if(SSL_get_error(ssl, r) == SSL_ERROR_ZERO_RETURN) { + int e = SSL_get_error(ssl, r); + if(e == SSL_ERROR_ZERO_RETURN) { /* EOF */ break; + } else if(e == SSL_ERROR_WANT_READ) { + continue; + } else if(e == SSL_ERROR_WANT_WRITE) { + continue; + } else if(e == SSL_ERROR_SYSCALL) { + if(verb) printf("could not SSL_read %s\n", + strerror(errno)); + } else if(e == SSL_ERROR_SSL) { + int er = ERR_peek_error(); + if(er) + printf("could not SSL_read: %s\n", + ERR_reason_error_string(er)); + } else { + if(verb) printf("could not SSL_read " + "(SSL_get_error %d)\n", e); } - if(verb) printf("could not SSL_read\n"); return 0; } if(endnl && buf[n] == '\n') { -- 2.47.3