Annotations V2.X and HTTPS

Hello first of all I want to say that we plan to upgrade to V3.X eventually but I don’t know when this will happen, meanwhile we are planing to continue using the V2.X, Sorry for the long write before hand.


I am facing an issue with our production servers regarding https connections, internally our IIS contains a Self-signed certificate (which was first designed for internal use) and a trusted company signed certificate which is the one being used for external access.

Whenever I connect to the server internally or externally the web page in fact lets me log in with the trusted certificate, but when I display the viewer for annotations, here comes the issue.

For some reason the viewer starts creating a bunch of references to JS files and CSS files that it need internally for using and displaying the viewer but instead of using the hostname it uses the internal IP of the server, which creates an err-invalid certificate or something because it uses the self signed certificate instead of the trusted one.

First of all this is a breach of security because you are showing to the outside world the internal IP address of the server and second we are having the system use an internal self signed certificate instead of the trusted one all because of the IP it is using.

Is there a way to change the URL from IP to hostname to overwrite that behavior?

Hi Elio,


I’m sorry to hear that you have such issue. Could you please provide more info about the issue:
1. The project type - MVC, Web Forms etc.?
2. The pipline mode.
3. Code example of the Annotation initialization in the App_start action and on the web page.

Thank you.

Hello


1.- The project Type is MVC.
2.- The Pipeline Mode is integrated
3.- This is pretty much my code on the web page.

<%= Html.Groupdocs().AnnotationScripts() %>
<%
using (FileStream fs = new FileStream(ViewBag.filePath, FileMode.Open, FileAccess.Read, FileShare.Read))
{ %>
<%=
Html.Groupdocs().Annotation()
.ElementId(“divViewer”)
.ShowFileExplorer(false)
.ZoomToFitWidth(true)
.ZoomToFitHeight(true)
.EnableTextSelection(true)
.AccessRights(Groupdocs.Common.AnnotationReviewerRights.All)
.Stream(fs, ViewBag.filename)
%>
<%} %>


Hi,


Thank you for the code example. In your code example I don’t see the code from the Application_Start action - since that please make sure you have routes.MapAnnotationRoutes() in it.

Best regards.

Hello yes of course I do have that, but it is not on the web page… it is on the global.asax.


You guys were asking for the web page code.

Anyway I do have the routes section with a very basic MVC pattern. This should not be the issue. I wonder about the IP used by the annotations itself when rendering. I need faster replies from you guys to be honest, this is affecting our production environment.

routes.MapAnnotationRoutes();

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

routes.MapRoute(
name: “Default”,
url: “{controller}/{action}/{id}”,
defaults: new { controller = “Home”, action = “Index”, id = UrlParameter.Optional }


Hi,


In such case you can use Groupdocs.Web.Annotation.WidgetFactory.SetBaseUrl(“your url”); to set the base adres for the all requests of the Annotation library. You should put this code just after Groupdocs.Web.Annotation.WidgetFactory.Initialize

Best regards.

Thank you very much for your support, so far my issue was solved with this code, we will continue testing, and on worst case scenario I will contact you guys again.

Hi,


Glad to hear that. Yes, sure feel free to contact us if you will need any help.

Best regards.