Unit tests for SecureHttpHelper

Refactor SecureHttpHelper for unit testing.