initializes the TrustManagerFactory to prevent IllegalStateException

Initializes the TrustManagerFactory to prevent "IllegalStateException: TrustManagerFactory is not initialized", caused by the call "trustManagerFactory.getTrustManagers()".

PS: nevermind the imports, they're just rearranged.