Welcome Guest Search | Active Topics | Sign In | Register

HtmlToPdfSession.LoadUrl fails on HTTPS Options
Mogens
Posted: Wednesday, March 7, 2018 9:36:09 PM
Rank: Newbie
Groups: Member

Joined: 10/21/2016
Posts: 3
Hi,

We have re-initiated a project started last year to upgrade your EO.PDF library from 5.0.64.2 to 2017.13.1, we then identified an issue with the HtmlToPdfSession.GetCookies() see https://www.essentialobjects.com/forum/postsm43022_HtmlToPdfSession-GetCookies-return-null.aspx#43022, all the code was re-tested on Windows 10 after the upgrading the library to version 17.1.14 and is all working on test environment, We then deployed the changes to our UAT server to verify that the new library would work in the production environment, the HtmlToPdfSession.LoadUrl fails to load the site using HTTPS, is there a work round or fix to this issue as I’ll not be able to load the site as HTTP in the UAT or production environment.
I have tried to upgrade to version 17.3.13 this version has the same issue.


Test Environment:
Windows 10 1709 Build 16299.192
IIS 10.0

UAT Test Environment:
Microsoft Windows Server 2012 R2 Standard


C# Code sample:
Code: C#
Dictionary<string, string> dict = new Dictionary<string, string>()
{
{"username", oXmlApp.SelectSingleNode("//Dispatch_Email/_admin/username").WithDefault(string.Empty)},
{"password", oXmlApp.SelectSingleNode("//Dispatch_Email/_admin/password").WithDefault(string.Empty)},
{"estar", "Login"},
{"isams", "permission"}
};


// Set up credentials to bypass Admin login
System.Net.CookieCollection myCookies = new System.Net.CookieCollection();
using (HtmlToPdfSession session = HtmlToPdfSession.Create()) {
//Load the log in page
session.LoadUrl(secureURL + "_admin/");  //&lt;-- Fails to load site when using HTTPS, and below code not executed
foreach (KeyValuePair<string, string> kvp in dict) {
session.Fill(kvp.Key, kvp.Value);
}

session.Submit("submit"); 

myCookies = session.GetCookies();
}
EO.Pdf.HtmlToPdf.Options.Cookies = myCookies;


Login form:
Code: HTML/ASPX
<form action="default.aspx?isams=permission" method="post" id="frm_main" autocomplete="off">
<input type="hidden" name="estar" value="Login">
<span>username</span>
<br>
<input tabindex="1" type="text" id="txt_user" name="username" maxlength="50">
<br>
<span>password</span>
<br>
<input tabindex="2" type="password" name="password" maxlength="50">
<div class="loginbuttons">
<input tabindex="3" alt="submit login" name="submit" title="submit login" type="image" src="images/btn_login.png">
</div>
</form>
eo_support
Posted: Thursday, March 8, 2018 11:06:56 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

There have been a couple of issues related to HTTPS in past versions. One is related to older version of TLS that has been addressed in EO.Pdf 2016, and then another one related to "invalid SSL certificate" that has been addressed in 17.2.43. Both were before version 17.3.13. So we are not sure if this is a new issue. You can try the current build (18.1.7) and see if that resolves the issue since it uses a newer browser engine.

Additionally, you can try to set HtmlToPdfOptions.SSLVerificationMode to None and see if that resolves the issue. See here for more details:

https://www.essentialobjects.com/doc/pdf/htmltopdf/ssl.aspx

If it still fails, please provide more information about exactly how it fails. If you get an error code/message or exception, please share and we will investigate further.

Thanks!
Mogens
Posted: Monday, March 19, 2018 9:06:55 PM
Rank: Newbie
Groups: Member

Joined: 10/21/2016
Posts: 3
Hi,

I have tried to add the HtmlToPdf.Options.SSLVerificationMode as suggested, it fails at the same point

If I where going to use the latest version would my existing license key work, I would not be happy if I had to purchase a new license for version 18 as we have not been able used the license we purchased for 17 to fix an issue where 5.0.64.2 would not work Windows 10.

eo_support
Posted: Tuesday, March 20, 2018 9:02:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

If you have purchased a license for V17 you may NOT need to purchase a new license for V18 because we provide free one year upgrade for all purchases. So if you have purchased V17 within the last year, you should be able to just log into your account to download a key for the current version (V18). If you can PM us your order number or license key, we can also check for you to be sure.

If you do decide to purchase a new license, make sure you try the current version out before you purchase ---- we are not aware of any SSL issue with the current version.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.