Sunday 13 November 2016

Loosing Https in redirection URLs behind an SSL OffLoading Load-Balancer.

We recently setup an application behind a load-balancer which was performing SSL Offloading and ... load-balancing. We had this setup in a lab using a software load-balancer (HAProxy) and in production using F5's BigIp load-balancer. The application sometimes builds redirection URLs based on the original URL that was used to access it. So if you access the app using https://theLB/myapp it should redirect to, say, https://theLB/myapp/login.do. That worked just fine with HAProxy which, I assume, has a set of default settings that are more comprehensive for non-LB experts. On the F5 side, we faced many issues though. First, the F5 sends the request to the app server like so: http://appServer1/myapp. This URL is what the application sees in the request and uses that for it's redirects, appServer1 being an internal address and port 80 not being open from the outside, this doesn't work for the end user.

To fix the Host Name issue (using theLB instead of appServer1) you must enable something like 'PreserveHost'. And finally to preserve the protocol (HTTPS vs HTTP) you need to add the X-Forwarded-Proto header. (For good mesure you could also add the X-Forwarded-Port header). Something like that for the F5:
 HTTP::header insert X-Forwarded-Proto "https"

Saturday 15 October 2016

Unity Asset Store issue (Updated)

Update: I wanted to share what worked for me to resolve this issue but it turns out that one reader had an even simpler solution that worked for me too: Just open the Asset tab (⌘ + 9) and undock it (bring it outside of the main Unity window) and voilà! Thanks to @Anonymous for the tip. If that doesn't work for you, read on.

Below I explain how to access and download packages from the Unity Asset Store even if your Asset Store tab remains blank / grey or (see near the end) if you get the "The server was unable to build the package. Please re-import" message using the method described below.

I just recently updated to Unity 5.x and noticed that the Asset Store doesn't work for me anymore. I have Unity 5.4.1f1 on macOs. Either going to the Asset Store from Safari and clicking "Open in Unity", or directly from within Unity (⌘ + 9), I always get an empty Asset Store tab.

Opening Dev Tools or moving the mouse arounds shows me that the page is actually loaded but just doesn't render. While I haven't yet found how to fix this, there's a workaround.

You can also browse the Asset Store by entering keywords in the Project tab search bar and selecting Asset Store. Select an Asset that seems to be in the package you're looking for and the inspector tab will show the details and allow you to import the whole package directly without opening the Asset Store.

Alternative Asset Store search

Now, if like me you haven't downloaded a package for a while you probably haven't accepted the latest Asset Store "Terms and Conditions" disclaimer. Unfortunately this alternative access to the Store doesn't give you the opportunity to accept those new Terms and you will get the following message "The server was unable to build the package. Please re-import". What you will need to do is install an older 4.x version of Unity which uses a different rendering method for the Asset Store and was working fine for me. With this older version, download any package from the Asset Store, accept the disclaimer and re-install the latest 5.x version. From now on, you will be able to use the alternative way described above to download packages.

Hope this helps. And if you know how to fix the rendering issue on macOS and Unity 5, please let me know.