setup.py 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. try:
  2. from setuptools import setup, find_packages
  3. except ImportError:
  4. from ez_setup import use_setuptools
  5. use_setuptools()
  6. from setuptools import setup, find_packages
  7. _long_description = '''
  8. This is a HTTPS client implementation for httplib and urllib2 based on
  9. PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation over the
  10. default provided with Python and importantly enables full verification of the
  11. SSL peer.
  12. Releases
  13. ========
  14. 0.3.1
  15. -----
  16. * extended utils functions to support keyword for passing additional urllib2
  17. handlers.
  18. 0.3.0
  19. -----
  20. * Added ndg.httpsclient.utils.fetch_stream_from_url function and added
  21. parameter for data to post in open_url and fetch_* methods.
  22. * fix to ndg.httpsclient.utils module _should_use_proxy and open_url functions
  23. 0.2.0
  24. -----
  25. * added support for SSL verification with subjectAltNames using pyasn1
  26. * fixed minor bug - SSL cert DN prefix matching
  27. 0.1.0
  28. -----
  29. Initial release
  30. Prerequisites
  31. =============
  32. This has been developed and tested for Python 2.6 and 2.7 with pyOpenSSL 0.13.
  33. Note that proxy support is only available from Python 2.6.2 onwards. pyasn1 is
  34. required for correct SSL verification with subjectAltNames.
  35. Installation
  36. ============
  37. Installation can be performed using easy_install or pip.
  38. Running ndg_httpclient
  39. ======================
  40. A simple script for fetching data using HTTP or HTTPS GET from a specified URL.
  41. Parameter:
  42. ``url``
  43. The URL of the resource to be fetched
  44. Options:
  45. ``-h, --help``
  46. Show help message and exit.
  47. ``-c FILE, --certificate=FILE``
  48. Certificate file - defaults to ``$HOME/credentials.pem``
  49. ``-k FILE, --private-key=FILE``
  50. Private key file - defaults to the certificate file
  51. ``-t DIR, --ca-certificate-dir=DIR``
  52. Trusted CA certificate file directory.
  53. ``-d, --debug``
  54. Print debug information - this may be useful in solving problems with HTTP or
  55. HTTPS access to a server.
  56. ``-p FILE, --post-data-file=FILE``
  57. POST data file
  58. ``-f FILE, --fetch=FILE``
  59. Output file
  60. ``-n, --no-verify-peer``
  61. Skip verification of peer certificate.
  62. '''
  63. setup(
  64. name='ndg_httpsclient',
  65. version="0.3.1",
  66. description='Provides enhanced HTTPS support for httplib and urllib2 using '
  67. 'PyOpenSSL',
  68. author='Richard Wilkinson and Philip Kershaw',
  69. author_email='Philip.Kershaw@stfc.ac.uk',
  70. url='http://ndg-security.ceda.ac.uk/wiki/ndg_httpsclient/',
  71. long_description=_long_description,
  72. license='BSD - See LICENCE file for details',
  73. namespace_packages=['ndg'],
  74. packages=find_packages(),
  75. package_dir={'ndg.httpsclient': 'ndg/httpsclient'},
  76. package_data={
  77. 'ndg.httpsclient': [
  78. 'test/README',
  79. 'test/scripts/*.sh',
  80. 'test/pki/localhost.*',
  81. 'test/pki/ca/*.0'
  82. ],
  83. },
  84. install_requires = ['PyOpenSSL'],
  85. extras_require = {'subjectAltName_support': 'pyasn1'},
  86. classifiers = [
  87. 'Development Status :: 3 - Alpha',
  88. 'Environment :: Console',
  89. 'Environment :: Web Environment',
  90. 'Intended Audience :: End Users/Desktop',
  91. 'Intended Audience :: Developers',
  92. 'Intended Audience :: System Administrators',
  93. 'Intended Audience :: Science/Research',
  94. 'License :: OSI Approved :: BSD License',
  95. 'Natural Language :: English',
  96. 'Operating System :: Microsoft :: Windows',
  97. 'Operating System :: POSIX :: Linux',
  98. 'Programming Language :: Python',
  99. 'Topic :: Security',
  100. 'Topic :: Internet',
  101. 'Topic :: Scientific/Engineering',
  102. 'Topic :: System :: Distributed Computing',
  103. 'Topic :: System :: Systems Administration :: Authentication/Directory',
  104. 'Topic :: Software Development :: Libraries :: Python Modules'
  105. ],
  106. zip_safe = False,
  107. entry_points = {
  108. 'console_scripts': ['ndg_httpclient = ndg.httpsclient.utils:main',
  109. ],
  110. }
  111. )