Fixed function to build array of SSL certificates