#679867 libxml2: "failed to load external entity" for https

Package:
libxml2
Source:
libxml2
Description:
GNOME XML library
Submitter:
Vincent Lefevre
Date:
2021-07-05 18:33:04 UTC
Severity:
important
#679867#5
Date:
2012-07-02 07:43:40 UTC
From:
To:
On the following file

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html SYSTEM "http://evolvis.org/DTD/xhtml10t-rdfa10.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head><title>.</title></head>
<body><p>nbsp;</p></body>
</html>

I get:

$ xmllint --noout --loaddtd --valid evolvis.html
error : Unknown IO error
evolvis.html:2: warning: failed to load external entity "http://evolvis.org/DTD/xhtml10t-rdfa10.dtd"
<!DOCTYPE html SYSTEM "http://evolvis.org/DTD/xhtml10t-rdfa10.dtd">
                                                                   ^
evolvis.html:3: validity error : Validation failed: no DTD found !
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
                                                                  ^

while Firefox and Lynx don't have any problem to open the DTD itself.
A strace shows:

[...]
sendto(5, "GET /DTD/xhtml10t-rdfa10.dtd HTT"..., 83, 0, NULL, 0) = 83
recvfrom(5, 0x7f2523f936a0, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}], 1, 60000) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "HTTP/1.1 301 Moved Permanently\r\n"..., 4096, 0, NULL, NULL) = 737
recvfrom(5, "", 4096, 0, NULL, NULL)    = 0
close(5)                                = 0
write(2, "error : ", 8)                 = 8
write(2, "Unknown IO error\n", 17)      = 17
stat("http://evolvis.org/DTD/xhtml10t-rdfa10.dtd", 0x7fff02c4dc40) = -1 ENOENT (No such file or directory)
stat("http://evolvis.org/DTD/xhtml10t-rdfa10.dtd", 0x7fff02c4dc40) = -1 ENOENT (No such file or directory)
stat("http://evolvis.org/DTD/xhtml10t-rdfa10.dtd", 0x7fff02c4dc40) = -1 ENOENT (No such file or directory)
stat("http://evolvis.org/DTD/xhtml10t-rdfa10.dtd", 0x7fff02c4dc40) = -1 ENOENT (No such file or directory)
stat("http://evolvis.org/DTD/xhtml10t-rdfa10.dtd", 0x7fff02c4dc30) = -1 ENOENT (No such file or directory)
stat("http://evolvis.org/DTD/xhtml10t-rdfa10.dtd", 0x7fff02c4dc30) = -1 ENOENT (No such file or directory)
write(2, "evolvis.html:2: ", 16)        = 16
write(2, "warning: ", 9)                = 9
write(2, "failed to load external entity \""..., 76) = 76
[...]

It seems that libxml2 doesn't follow redirections.

Note: this DTD URL is currently used by INRIAGforge:

https://gforge.inria.fr/

#679867#10
Date:
2013-10-24 04:39:50 UTC
From:
To:
It is not the problem of 301, it is due to https, which xmlint doesn't support.

And, I don't think xmllint should support https, it will take ssh or
gnutls as it's depends.

#679867#15
Date:
2013-10-24 07:36:27 UTC
From:
To:
I diagree. https is more and more used in general and provides
security. I don't see the dependency as a problem, as many packages
already depend on libgnutls* and libssl*.

#679867#20
Date:
2017-01-23 19:30:48 UTC
From:
To:
This is becoming a bigger problem as a greater percentage of the web moves
over to HTTPS. I was trying to work on an IETF RFC draft and that's no
longer possible using libxml2 because URLs like
http://xml.resource.org/public/rfc/bibxml/reference.RFC.1321.xml now
unconditionally redirect to HTTPS.

Chris

#679867#25
Date:
2018-05-30 15:31:27 UTC
From:
To:
Control: retitle -1 libxml2: "failed to load external entity" for https
Control: severity -1 important

Yes, https is now the standard. I now have this problem with mpfr.org
(https is new, and HSTS even newer), after some hard time trying to
find the cause (to make things worse, the error message is very
unhelpful).