disallow port or username from being None

Change-Id: Id81f0d0824698bace4bd0fca8148ecef57c67223