Fix return value of maybeKeyManagerFactory and maybeTrustManagerFactory.