You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Neil Smeby <ne...@infinitecampus.com> on 2018/12/20 16:50:09 UTC

https external-graphics

Hello,
I'm having some problems with getting images to resolve when using https instead of http. An example .fo file follows:
<?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> 

When I run this:
java.exe -Djava.ext.dirs=C:\fop\fop-2.3 org.apache.fop.cli.Main -d -fo C:\foo\testhttps.fo -pdf C:\foo\testhttps.pdf

Despite curl being able to fetch this image (using https), I get this error:
SEVERE: Image not found. URI: https://ichef.bbci.co.uk/images/ic/960x540/p01br4cp.jpg. (See position 13:202)

But when I simply change https to http, things work. Is that expected? If so, why isn't https supported? Are there any workarounds?
Thanks in advance for any help/advice!

-Neil


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: https external-graphics

Posted by Chris <bo...@hotmail.com>.
Hi Neil,

It could be that the certificate used in by the https service is self 
signed. This means Java won't trust it by default unless you import it 
into the Java Trust store. Open the URL in the browser and inspect the 
certificate to see what kind of certificate the service is using to 
encrypt the https data.

Thanks,

Chris

On 20/12/2018 16:50, Neil Smeby wrote:
> Hello,
> I'm having some problems with getting images to resolve when using https instead of http. An example .fo file follows:
> <?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>
>
> When I run this:
> java.exe -Djava.ext.dirs=C:\fop\fop-2.3 org.apache.fop.cli.Main -d -fo C:\foo\testhttps.fo -pdf C:\foo\testhttps.pdf
>
> Despite curl being able to fetch this image (using https), I get this error:
> SEVERE: Image not found. URI: https://ichef.bbci.co.uk/images/ic/960x540/p01br4cp.jpg. (See position 13:202)
>
> But when I simply change https to http, things work. Is that expected? If so, why isn't https supported? Are there any workarounds?
> Thanks in advance for any help/advice!
>
> -Neil
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
> .
>


RE: https external-graphics

Posted by Simon Steiner <si...@gmail.com>.
Hi,

What java version are you using, try using a recent version. Since the https
cert may not be in your jdk.

Thanks

-----Original Message-----
From: Neil Smeby <ne...@infinitecampus.com> 
Sent: 20 December 2018 16:50
To: fop-users@xmlgraphics.apache.org
Subject: https external-graphics

Hello,
I'm having some problems with getting images to resolve when using https
instead of http. An example .fo file follows:
<?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> 

When I run this:
java.exe -Djava.ext.dirs=C:\fop\fop-2.3 org.apache.fop.cli.Main -d -fo
C:\foo\testhttps.fo -pdf C:\foo\testhttps.pdf

Despite curl being able to fetch this image (using https), I get this error:
SEVERE: Image not found. URI:
https://ichef.bbci.co.uk/images/ic/960x540/p01br4cp.jpg. (See position
13:202)

But when I simply change https to http, things work. Is that expected? If
so, why isn't https supported? Are there any workarounds?
Thanks in advance for any help/advice!

-Neil


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org