*/
while ((ret = BIO_write(bio,
(const unsigned char *)(buf + pos),
- send_len)) < 0)
+ send_len)) <= 0)
{
if (!BIO_should_retry(bio))
{
len = BIO_get_mem_data(bio, &bio_mem_data);
encoded_text = html_encode(bio_mem_data);
+ if (encoded_text == NULL)
+ {
+ log_error(LOG_LEVEL_ERROR,
+ "Failed to HTML-encode the certificate information");
+ ret = -1;
+ goto exit;
+ }
+
strlcpy(last->info_buf, encoded_text, sizeof(last->info_buf));
freez(encoded_text);
ret = 0;
csp->http->hash_of_host_hex);
if (BIO_do_handshake(ssl_attr->openssl_attr.bio) != 1)
{
- log_ssl_errors(LOG_LEVEL_ERROR, "BIO_do_handshake failed");
+ log_ssl_errors(LOG_LEVEL_ERROR,
+ "The TLS/SSL handshake with the client failed");
ret = -1;
goto exit;
}
if (BIO_do_handshake(ssl_attrs->bio) != 1)
{
- log_ssl_errors(LOG_LEVEL_ERROR, "BIO_do_handshake failed");
+ log_ssl_errors(LOG_LEVEL_ERROR,
+ "The TLS/SSL handshake with the server failed");
ret = -1;
goto exit;
}