setup.py 4.2 KB

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