]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix test with https zone for libressl. master
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 20 Apr 2026 14:10:33 +0000 (16:10 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 20 Apr 2026 14:10:33 +0000 (16:10 +0200)
doc/Changelog
testcode/petal.c

index 66b2fdddb46dca3d2dd8100df2258728e7603d4b..c0c54759cdd74d87101033908f22fc9419425f32 100644 (file)
@@ -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,
index d7d7e07ccb331536da2ff90172859ad2af586e02..ec99a092d9bde50c4d4003aef973f0d946df7ca8 100644 (file)
@@ -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') {