HTTP client: Work around the 'gets' method not being supported by SSL BIOs
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Thu, 18 Nov 2021 19:43:06 +0000 (20:43 +0100)
committerDr. David von Oheimb <dev@ddvo.net>
Tue, 21 Dec 2021 12:04:14 +0000 (13:04 +0100)
commit606c79e29bbc26c27c3b85cc52fe7d72051184de
treeb77504e3b3adb99c2ec5a58655f54d23afcc4d5f
parenta497a90213b50c499f2a385e63e1fa6e13ef283a
HTTP client: Work around the 'gets' method not being supported by SSL BIOs

It turned out that loading non-ASN.1 contents using the HTTP client
fails over TLS because SSL BIOs do not support the gets method.

This PR provides a workaround by using the less efficient BIO_get_line() function
in case BIO_gets() returns -2, which means that it is not supported by the BIO.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17317)
crypto/http/http_client.c