diff options
Diffstat (limited to 'debian/patches/fix-tls-1.3.patch')
-rw-r--r-- | debian/patches/fix-tls-1.3.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/debian/patches/fix-tls-1.3.patch b/debian/patches/fix-tls-1.3.patch new file mode 100644 index 0000000..e318b76 --- /dev/null +++ b/debian/patches/fix-tls-1.3.patch @@ -0,0 +1,48 @@ +Description: Fix connection to HTTPS sites offering TLS 1.3 +Author: Andreas Metzler <ametzler@bebt.de> +Origin: https://lists.gnu.org/archive/html/lynx-dev/2018-12/msg00009.html + +--- a/src/tidy_tls.c ++++ b/src/tidy_tls.c +@@ -462,13 +462,25 @@ + { + int rc; + +- rc = (int) gnutls_record_recv(ssl->gnutls_state, buffer, (size_t) length); ++ do ++ { ++ rc = (int) gnutls_record_recv(ssl->gnutls_state, buffer, (size_t) length); ++ } ++ while ((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)); + + if (rc < 0 && gnutls_error_is_fatal(rc) == 0) { + if (rc == GNUTLS_E_REHANDSHAKE) { + (void) gnutls_handshake(ssl->gnutls_state); +- gnutls_record_send(ssl->gnutls_state, ssl->sendbuffer, (size_t) ssl->bytes_sent); +- rc = (int) gnutls_record_recv(ssl->gnutls_state, buffer, (size_t) length); ++ do ++ { ++ rc = (int) gnutls_record_send(ssl->gnutls_state, ssl->sendbuffer, (size_t) ssl->bytes_sent); ++ } ++ while ((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)); ++ do ++ { ++ rc = (int) gnutls_record_recv(ssl->gnutls_state, buffer, (size_t) length); ++ } ++ while ((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)); + } + } + +@@ -500,7 +512,11 @@ + { + int rc; + +- rc = (int) gnutls_record_send(ssl->gnutls_state, buffer, (size_t) length); ++ do ++ { ++ rc = (int) gnutls_record_send(ssl->gnutls_state, buffer, (size_t) length); ++ } ++ while ((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)); + ssl->last_error = rc; + + if (rc < 0) { |