Closed GoogleCodeExporter closed 8 years ago
Ok, I found out what the problem was. It's not a bug in xhtmlrenderer and
doesn't
need any change in any code...
The problem is that when the Java web application tries to load the css of
jmesa to
export as a pdf, it tries to download it using a secure path (https:\\...). For
this,
the Java default keystore of ssl trusted certificates
(%JAVA_HOME%\jre\lib\security\cacerts) MUST have the certificate of the server
that
hosts the application.
Java doesn't ask if you trust the server (even if it's the server running the
java
app...) like the browser does, it will just throw the exception and tell that
can't
load the css (some HandShakeSSLException)
So I close my own Issue, ;)
By the way, thanks for the good work and the best "table creator" I've seen.
Cheers from Spain
Original comment by AlejaV...@gmail.com
on 3 Mar 2009 at 8:51
I forgot, if someone has the same problem and is using Tomcat this would help:
If you created your SSL Tomcat certificate like this:
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA -validity 3650
then you have it in your OWN keystore (located in a .keystore file in your home
directory, the same in Windows and Unix)
You need it in the java keystore, so you can export it from there and import it
to
the java keystore like this:
%JAVA_HOME%\jre\lib\security>keytool -export -alias tomcat -file tomcat.crt
%JAVA_HOME%\jre\lib\security>keytool -import -alias tomcat -file tomcat.crt
-keystore
cacerts
Hope this can help someone,
cheers
Original comment by AlejaV...@gmail.com
on 3 Mar 2009 at 8:55
Original comment by jeff.johnston.mn@gmail.com
on 4 Mar 2009 at 8:03
Is there another way to overcome this issue? I mean setting the jmesa-pdf.css
in Java
code.
Original comment by duongl...@gmail.com
on 1 Apr 2009 at 9:20
Hi Alex
I have exactly the same problem that you faced. I am new to the SSL stuff.
I am rendering a PDF document using xhtmlrender and everything was fine until
we moved to https. I am facing the same problem when reading the style sheets
through https.
I tried out the steps you've given for tomcat (generating a certificate,
exporting and importing into java). But the last step fails saying -
keytool error: java.io.IOException: Keystore was tampered with, or password was
incorrect
I've given the right password - i tried the pwd i gave while generating the
certificate, i tried the default 'changeit' but it throws the same error.
Can you help???!!!!
Thanks
Hese.
Original comment by 1024h...@gmail.com
on 29 Sep 2010 at 2:42
Original issue reported on code.google.com by
AlejaV...@gmail.com
on 2 Mar 2009 at 6:42