build app urls based on wildcard ssl or app ssl

 - includes unit tests

closes #843