17 mars 2016

Citrix Netscaler - HTTP to HTTPs sharepoint page rewrite

The contex: sharepoint is accessed directly on http internally.
We came across a problem that some of our Sharepoint page have hardcoded link instead of dynamic link so when we expose the page externally the link are static to HTTP and since the page are accessed on a secure connection the browser complain that there is unsecure data accessed in clear text instead of SSL. The work around is to rewrite the page body when they are returned to the end user so that the link contained in the page are httpS instead of http. I tried doing rewrite response body without succes and then Citrix consultant suggested to use URL Transformation feature under AppExpert -> Rewrite -> URL Transformation instead that provided a working solution for us.

First we create the profile and enter a descriptive name: TrProfile_http-httpS

Now edit this profile to add an action by clicking on insert:
Name: http2https-action
Priority: 20
Enable = Check
Response URL From: http://(.*)
Response URL Into: https://$1

Click OK.

After that we create the Policies
Name:  TrPol-http-https
Profile: TrProfile_http-httpS
Expression: HTTP.REQ.IS_VALID

Click OK.

Finally bind this transform Policy to a CS or LB Vserver:

Edit your Vserver, click the "PLUS" sign under policies, choose: transform -> Request and then bind your newly created transform policy: TrPol-http-https

Click OK, Click Done.

Now when the end users access the page, the Netscaler transform all http link in the page to https and we didn't need the developper to build a new page for external users.








Aucun commentaire:

Publier un commentaire