setup.py 4.7 KB

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