copied some files from wget

will be used to implement ssl support.