|
Rank: Member Groups: Member
Joined: 8/11/2015 Posts: 19
|
Hello,
We have one customer that continues to have the message pop up "A certificate error occurred. Please handle the CertificateError event." We have implemented the suggestion as follows:
private void WebControl_CertificateError(object sender, CertificateErrorEventArgs e) { if (e != null) e.Continue(); }
They continue to have the issue. Here is some information from our customer:
"We've been having this message for about a year. It only affects computers which are blocked from accessing certain external websites via Cisco OpenDNS. OpenDNS allows us to control DNS responses based on Arrive Directory user principals, so we can control where users can navigate to on the internet. The EOBrowser has some undocumented dependency on the internet that our OpenDNS system is blocking. We either need to know what URL it's accessing so we can white-list it, or for the error to go away."
Does EO have a dependency on an external website or internet location? If so, what is it and can it be white-listed? I noticed the eowp.exe and other EO dll's are signed by Symantec. Should they try and white-list Symantec somehow? Is there something else I should try other than handling the CertificateError event?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
The only case when you will receive this error is when the WebView's CertificateError event handler is null. So you may want to check whether you have WebView's that you have not hooked up the event handler. Note that not all WebViews are created by your code. For example, the WebView object passed to your NewWindow event handler (in case a popup window) is not created by your code.
We are not aware of any kind of "undocumented dependency on the Internet". EO.WebBrowser is based on Google's Chromium project so it should have the same behavior as the regular Google Chrome browser unless other softwares on the system treated them differently (for example, you may have firewall rules that explicitly whitelist Google Chrome but does not white list your application that uses EO.WebBrowser).
Thanks!
|
|
Rank: Member Groups: Member
Joined: 8/11/2015 Posts: 19
|
Thank you for your response. I am a little confused about the statement "Note that not all WebViews are created by your code. For example, the WebView object passed to your NewWindow event handler (in case a popup window) is not created by your code.". Should I be worried that there is a WebView created with the following code that I am not aware of:
<eo:WebControl Name="uiWebControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="0" Visibility="{Binding IsBrowserVisible, Converter={StaticResource VisibilityOfBool}}"/>
The above code is the XAML on a WPF UserControl. The WebView for WebControl is created in a ViewModel at run time. Are you saying that when a WebControl is referenced in XAML that a WebView is automatically created? If so, should I destroy it (set it to null) before assigning a new WebView to it?
I have another question. Since the EO browser is based on Chromium, do you think they will see the same error using a Chrome browser or do you think Chrome will hide the error?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi, A WebView can create another WebView when a popup window is opened. For example, if you load the following code in the WebView that you created in your code:
Code: HTML/ASPX
<script>
var wnd = window.open(another_url);
.....
</script>
Then internally the WebView (which is created by you) will create a second WebView to load another_url. This second WebView is NOT directly created by your code. However this is not to say this second WebView is invisible to you. Once this second WebView is created, the first WebView's NewWindow event will be raised and you will "see" this second WebView through the NewWindow event's event arguments. You MUST explicitly "accept" this second WebView (to show how display it, for example, you can choose to display it in a new window, or in a new tab, or display it side to side next to your original WebView. Exactly how to display it is completely up to you) in order for window.open to be successfully. If this second WebView tries to load a page with an invalid certificate and you do not handle this second WebView's CertificateError event, you will receive the same "A certificate error occurred" error. Chromium browser engine handles this same error differently but similar. It will display a warning page and you will have the option to ignore and proceed. However as we mentioned in our original reply, it is possible that you do not see this error in Chrome because the settings on your system somehow treats Chrome and your application differently. That would be a different matter if you wish to find out what's different on that aspect. From our component point of view, the only case you get this error is when you do not handle the WebView's CertificateEror event. Hope this clears up. Thanks!
|
|
Rank: Member Groups: Member
Joined: 8/11/2015 Posts: 19
|
I think what you are saying refers to the window.open in a scripting language. We are using WPF and C# and do not open up more than 1 control/window for the EO browser. We do recreate the WebView for the WebControl at an interval to accommodate a memory leak we found and were unable to find a suitable solution for (this was a separate EO support ticket). What you are saying does not seem to be our scenario.
Here is how we create the WebView:
private void createAndAssignWebView(EO.Wpf.WebControl p_webControl) { if (m_model != null) { m_model.WebView = new EO.Wpf.WebView();
m_model.WebView.Engine = m_engine; m_model.InitializeView();
if (p_webControl != null) p_webControl.WebView = m_model.WebView; } }
The WebView's CertificateError event is created with the callback to handle the event in m_model.InitializeView(). It gets properly disposed when we recreate a new WebView for the existing WebControl. Does this sound like a good approach to you or is there some other WebView created that I am not aware of?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
How do you know the code in your WebView won't try to open a popup window with JavaScript? Have you tried to handle NewWindow event?
There is absolutely nothing else we can tell you rather than this: The ONLY situation you get this error is when you have a WebView without a CertificateError handler. So you focus should be try to find out how that happened.
|
|
Rank: Member Groups: Member
Joined: 8/11/2015 Posts: 19
|
Okay, I think I understand what you are referring to. It's the code that is running inside the EO browser WebView, not the code to launch the WebView in a WebControl in WPF. The code for our particular scenario is an app we created. It is what is what is running when this error occurs. There are no calls to window.open in the JavaScript. It sounds like the event would need to be handled in the JavaScript code within the WebView as well as WPF. However, there may be a control we are using that calls a pop up window such as a date/time picker. If that's the case, it will be nearly impossible to handle this event with third party controls.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
You are not getting this correctly...Let me try to outline the chain of events: 1. JavaScript in the primary WebView calls window.open (assuming third party code, you have no control over this step); 2. A secondary internal WebView object will be created by EO library (this is the consequence of step 1, again you have no control over this step); 3. The primary WebView's NewWindow event will be called, with the newly created WebView passed to you through the event argument. You must handle this event; 4. Inside your event handler you must hook up CertificateError for this secondary WebView; If step 1 and step 2 happens (which you can't stop) and you do not do step 3 and step 4, then you will get the error you are getting. So the conclusion is you must do step 3 and step 4. There are more to these 4 steps. But to understand these 4 steps is crucial. So make sure you understand these first. Then you can take a look of this help topic on how to handle NewWindow event properly: https://www.essentialobjects.com/doc/webbrowser/advanced/new_window.aspxWhere you seems to be confused is the relationship between JavaScript code window.open (step 1) and WebView.NewWindow event (step 3). The later is the consequence of the former. But the NewWindow event is a .NET event on the WebView object. It is not a JavaScript event. We are not talking about any JavaScript event here. We are talking about certain JavaScript code can trigger certain .NET events that you need to handle properly. Hope this gets you to the right direction. Thanks!
|
|
Rank: Member Groups: Member
Joined: 8/11/2015 Posts: 19
|
Thanks for the info. I have hooked up the the CertificateError event in the NewWindow event handler. I'll give this a try to see if it is able to solve our problem.
|
|
Rank: Member Groups: Member
Joined: 8/11/2015 Posts: 19
|
Thanks for the info. I have hooked up the the CertificateError event in the NewWindow event handler. I'll give this a try to see if it is able to solve our problem.
|
|