5 Replies Latest reply: Jul 1, 2015 2:21 AM by haimanta Barkakati RSS

    SSL with Redirect from http to https

    Chris Cammers

      Hello,

       

      I have a scenario that we struggled with but I feel like I finally cracked the issue and I'd like to brag a little and field some criticism too. So please provide opinions about what you are doing in your deployments so we can figure out if we've done things the best way possible.

       

       

      I have a Qlikview SBE on version 11.20.11922.0

      in order to allow our mobile users to use Qlikview from ipads and other devices we have opened the environment over the internet and have implemented an SSL cert.

       

      In addition to that we had a requirement that if the user calls the http site instead of https we want the webserver to automatically redirect the the https site.

       

      All the threads on that topic led me to beleive that it was not possible with just the QVWS.

       

      So at first we tried deploying Qlikview to iis. we deployed qlikview to the default web page in iis and got ssl working with few problems. then we tried to implement the redirect. THIS WAS A NIGHTMARE, the sources of information on this topic are all over the map about the best way to do this sort of thing.

       

      1.      We tried various configurations of the "http redirect" feature
      2.      Then we tried "URL rewrite"

       

      Both of these solutions promised to be simple and "work like a charm" but our deployment was dogged by a fairly persistent "redirect loop" error. There were many iis guru's out there suggesting how to overcome redirect loops in iis but those solutions were identical to what he had already tried and failed.

       

      We did finally get the redirect working but then we could not provide hyperlinks directly to a document, basically the redirect would cause the query string to be dropped from the url and the user would be presented with just good ol' access point instead of the document they wanted.

       

       

      At this point I decided to try something radical.

       

      I let decided that the redirect loop might be overcome if I installed IIS and QVWS. I thought that IIS could handle all the traffic on port 80 and QVWS would handle port 443

       

      I will say that restoring iis to it's default state was not easy but once I managed to get IIS's settings cleaned up and the QVWS running with the ssl, setting up the rule for redirecting from the IIS default web site to https was easy and it worked like a charm.

       

       

      To set up the QVWS with SSL I used the procedure found in the attached word document, this was put together by Bill Britt who is a regular contributer to the ssl discussion.

       

      To set up the URL rewrite rule I used the procedure described in the attached PDF, it is a screen grab from http://www.jppinto.com/2010/03/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0/ I copied it in case the blog where I found it changes or the post becomes inaccessible.

       

       

      On another note, I was also able to simplify the url that the user has to call. For example the default access point URL is http://Server/qlikvew I know it is not a difficult path but if you want you can get them there with just http://ServerName.

       

      Go into the web panel of the QVWS config page and in the Root Folders section add a folder with no name and duplicate the path found in the QLIKVIEW entry.

       

      So the whole point of this was to get your feedback, please let me know what you think and feel free to ask any questions about how we did it.

       

      Thanks

       

      Chris

        • Re: SSL with Redirect from http to https
          Barry Harmsen

          Hi Chris,

           

          Good to hear that you made it work, though I am very curious to hear exactly what issues you ran into. Just to add my experiences, I always use IIS and URL Rewrite 2.0 for this together with the following rule in web.config:

           

          <rewrite>

                <rules>

                     <rule name="HTTP to HTTPS redirect" stopProcessing="true">

                     <match url="(.*)" />

                     <conditions>

                          <add input="{HTTPS}" pattern="off" />

                     </conditions>

                     <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" />

                     </rule>

                </rules>

          </rewrite>

           

          One thing that can be deceiving is the "Require SSL" setting under the "SSL Settings", you do not need to enable this as the rewrite rule takes care of it.

           

          Regarding the simpler URL, I sort of cheat and just add an index.html file to the root folder which does a redirect to the /QlikView folder:

           

          <html>

              <head>

                  <meta http-equiv="refresh" content="0; URL=/qlikview/index.htm">

              </head>

              <body style="background-color: #ffffff;">

                  <center><a href="/qlikview/index.htm">Redirect to QlikView</a></center>

              </body>

          </html>

           

          Kind regards,

           

          Barry

          http://www.qlikfix.com

          http://www.masterssummit.com

          • Re: SSL with Redirect from http to https
            haimanta Barkakati

            Hi Chris,

             

            Need your help !!

             

            I have QV SBE installed and we are using QV Web Server.

            We have successfully implemented SSL and our access point is on "https".

             

            Regarding auto redirect of URL from http to https, I found out from your document that we need to add the Redirect URL code in the QVWS config.xml but I am confused where to add that code.

             

            Kindly help me exactly where to add that piece of code in the QVWS config.xml.

            Thanks in advance.

             

            Regards,

              • Re: SSL with Redirect from http to https
                Chris Cammers

                Hi,

                 

                I'm not really sure what Barry is talking about, well I mean I don't have quite enough brain cycles available to try to riddle it out. To your question, in the management console in the setup area for the Qlikview web Server there is a web tab you can add a entry in there that will direct to the same path as the Qlikview path but will not have a virtual folder name.

                 

                I hope that makes sense, I don't have access to an environment right now to include a screenshot.

                  • Re: SSL with Redirect from http to https
                    haimanta Barkakati

                    Hi Chris,

                     

                    I think I wrote the wrong file name and wasn't able to explain my query properly.

                    Let me rephrase it.

                     

                    The following code obtained from your pdf is for Rewrite URL for QV Server using QVWS:

                    <rule name="Redirect to HTTPS" stopProcessing="true">

                    <match url="(.*)" />

                    <conditions><add input="{HTTPS}" pattern="^OFF$" />

                    </conditions>

                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther"

                    </rule>

                    I don't know where to add this code in web.config obtained from C:\Program Files\QlikView\Web path.

                     

                    Below are my questions :

                    1. Am I right in saying that this piece of code should be added in web.config obtained from C:\Program Files\QlikView\Web ?

                    2. If not, which is the other config file and exactly where should I paste this piece of code in order to rewrite my URL from http to https.

                     

                    I hope my questions are more clear now.

                    Kindly help me answer these queries.

                     

                    Regards,

                    Sarang M. Mehta

                    • Re: SSL with Redirect from http to https
                      haimanta Barkakati

                      Hi Chris,

                       

                      In addition to my query mentioned in the above post, I got another web.config file at the following location :

                      "C:\Program Files\QlikView\Server\QlikViewClients\QlikViewAjax"

                       

                      Now I am confused which file from the following should be used for adding the URL Rewrite code :

                      1. C:\Program Files\QlikView\Server\QlikViewClients\QlikViewAjax - (contains around 30-35 lines of code)

                      2. C:\Program Files\QlikView\Web  - (contains only three lines of code with xml version and <Configuration> tags.

                       

                      Kindly help.

                       

                      Regards,