2

I've been using EvoPdf version 3.5 without problem for long but all of a sudden it can’t read a stylesheet from SSL.

string html = "<link href=\"https://www.domain.com/styles.css\" rel=\"stylesheet\" type=\"text/css\" />Test";
PdfConverter pdfConverter = new PdfConverter();
byte[] bytes = pdfConverter.GetPdfBytesFromHtmlString(html);

It works fine if loading stylesheet from http. And on another IIS the stylesheet can be read from SSL.

I have no idea about how to troubleshoot this. Can it be a DNS issue?

Kristoffer Jälén
  • 4,112
  • 3
  • 30
  • 54
  • 1
    It is likely a trust issue. The server hosting your application may not trust the certificate for www.domain.com. This could be the root CA or cert itself is not trusted, or it could be the certificate for www.domain.com has expired or has somehow changed. Since you say it works on another server, it is likely a trust issue and not an issue with the cert itself. One easy way to troubleshoot is to load the resource using IE on the server, and look for SSL warnings/errors. – mikey May 15 '15 at 13:24
  • IIS says "This certificate is OK". I've loaded the resource using IE (8) on the server, and the first it's loaded, it can't be found, but if I load it once again, it's loaded. Strange. – Kristoffer Jälén May 15 '15 at 13:45
  • It sounds like the server that is hosting the css file is having issues serving up the css file. – Michael Adamission May 15 '15 at 15:49

3 Answers3

4

The reason was that SSL 3.0 was disabled on the server and versions of EVO HTML to PDF converter lower than 4.0 don’t have full support for TLS and therefore might not work properly on all the servers when accessing HTTPS documents or resources. This can lead to errors, missing images and styles if those resources are referenced by HTTPS URLs in HTML document.

Kristoffer Jälén
  • 4,112
  • 3
  • 30
  • 54
0

you can try download pdf viewer from chrome store. it's working ready for ssl pdf and it's working for me.

Display pdf in iframe using ssl/https based

Community
  • 1
  • 1
Chris
  • 75
  • 11
0

I experienced this issue after moving a site to a new web server. I was advised by the support team at EvoPdf to change my CSS reference to hit it by IP:

Dim csspath As String = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + ResolveUrl("~/") + "Styles/MyStyles.css"
Dim rootIP As String = System.Net.Dns.GetHostEntry(Request.Url.Host).AddressList(0).ToString()
csspath = csspath.Replace("mydomain.com", rootIP)

It's certainly a workaround, but after being unable to locate the source of the issue on the web server or in IIS, this resolved the issue.

Haywain
  • 88
  • 4