1

When I have a .fo document that contains a reference to an image using https, it doesn't render and I get an error in fop output. For example:

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
        <fo:simple-page-master page-width="8.5in" page-height="11in" master-name="BodyPage">
            <fo:region-body margin-top=".5in" margin-right=".5in" margin-bottom=".5in" margin-left=".5in"/>
            <fo:region-before region-name="header" extent=".5in" display-align="after"/>
            <fo:region-after region-name="footer" extent=".5in" display-align="before"/>
        </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="BodyPage">
        <fo:flow flow-name="xsl-region-body">
            <fo:block space-before="1pc">
                <fo:external-graphic src="url(https://ichef.bbci.co.uk/images/ic/960x540/p01br4cp.jpg)" overflow="hidden" content-width="scale-to-fit" content-height="scale-to-fit" width="100%" scaling="uniform"/>
            </fo:block>
        </fo:flow>
    </fo:page-sequence>
</fo:root>

produces this error:

SEVERE: Image not found. URI: https://ichef.bbci.co.uk/images/ic/960x540/p01br4cp.jpg. (See position 13:202)

But simply modifying the url to be just http works fine. It is not a network issue as curl on the https url works just fine (via TLS 1.2). How do I get secure resources to load in my PDFs?

NeilS
  • 11
  • 2
  • Welcome to SO! I guess this has something to do with the truststore of java, you might have to import the server certificate there. Details probably depend on your java version. – Stefan Hegny Dec 20 '18 at 20:21
  • Doesn't seem to be. When I use the little code here: https://stackoverflow.com/questions/4328711/read-url-to-string-in-few-lines-of-java-code to fetch the image, that is completely successful. – NeilS Jan 08 '19 at 18:27

1 Answers1

0

Aha! My command line contained -Djava.ext.dirs= which is known to break the RSA step in the SSL setup (see RSA Premaster secret error). Using -Dfop.home= does not cause the issue.

NeilS
  • 11
  • 2