Commit Graph

111 Commits

Author SHA1 Message Date
Victor Stinner 17ca323e7c (Merge 3.1) Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional
OpenSSL is now compiled with OPENSSL_NO_SSL2 defined (without the SSLv2
protocol) on Debian: fix the ssl module on Debian Testing and Debian Sid.

Optimize also ssl.get_protocol_name(): speed does matter!
2011-05-10 00:48:41 +02:00
Victor Stinner ee18b6f2fd Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional
OpenSSL is now compiled with OPENSSL_NO_SSL2 defined (without the SSLv2
protocol) on Debian: fix the ssl module on Debian Testing and Debian Sid.

Optimize also ssl.get_protocol_name(): speed does matter!
2011-05-10 00:38:00 +02:00
Antoine Pitrou 9c25486093 Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve private keys. 2011-04-03 18:15:34 +02:00
Victor Stinner 80f75e684e Issue #10989: Fix a crash on SSLContext.load_verify_locations(None, True).
Patch reviewed by Antoine Pitrou, okayed by Georg Brandl.
2011-01-29 11:31:20 +00:00
Hirokazu Yamamoto 8e63c687ef Merged revisions 87140 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87140 | hirokazu.yamamoto | 2010-12-09 19:49:00 +0900 (木, 09 12 2010) | 2 lines

  Should call Py_INCREF for Py_None (Modules/_ssl.c: PySSL_cipher)
........
2010-12-09 12:30:05 +00:00
Hirokazu Yamamoto 524f10359b Should call Py_INCREF for Py_None (Modules/_ssl.c: PySSL_cipher) 2010-12-09 10:49:00 +00:00
Antoine Pitrou c4df784514 Issue #10272: The ssl module now raises socket.timeout instead of a generic
SSLError on socket timeouts.
2010-12-03 19:59:41 +00:00
Antoine Pitrou 664c2d1fc0 Issue #10443: Add the SSLContext.set_default_verify_paths() method. 2010-11-17 20:29:42 +00:00
Antoine Pitrou fb0469112f Issue #10022: The dictionary returned by the `getpeercert()` method
of SSL sockets now has additional items such as `issuer` and `notBefore`.
2010-11-09 20:21:19 +00:00
Antoine Pitrou d532321f7b Issue #5639: Add a *server_hostname* argument to `SSLContext.wrap_socket`
in order to support the TLS SNI extension.  `HTTPSConnection` and
`urlopen()` also use this argument, so that HTTPS virtual hosts are now
supported.
2010-10-22 18:19:07 +00:00
Benjamin Peterson 31370951c0 Merged revisions 85432 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85432 | benjamin.peterson | 2010-10-13 17:06:39 -0500 (Wed, 13 Oct 2010) | 1 line

  constify to appease compiler warnings
........
2010-10-13 22:20:48 +00:00
Benjamin Peterson eb1410fc40 constify to appease compiler warnings 2010-10-13 22:06:39 +00:00
Antoine Pitrou fc113eeb7d Define a "session_id_context" at context creation. This is recommended
for the OpenSSL server-side session cache.
2010-10-13 12:46:13 +00:00
Gregory P. Smith bd4dacb3f9 Fix compile on NetBSD 5.0 (or anything else using an old 0.9.9-dev OpenSSL). 2010-10-13 03:53:21 +00:00
Antoine Pitrou b0182c8ca5 Issue #10075: Add a session_stats() method to SSLContext objects. 2010-10-12 20:09:02 +00:00
Antoine Pitrou 10c4c23a25 Merged revisions 84464 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84464 | antoine.pitrou | 2010-09-03 20:38:17 +0200 (ven., 03 sept. 2010) | 3 lines

  Issue #3805: clean up implementation of the _read method in _ssl.c.
........
2010-09-03 18:39:47 +00:00
Antoine Pitrou 24e561ae04 Issue #3805: clean up implementation of the _read method in _ssl.c. 2010-09-03 18:38:17 +00:00
Antoine Pitrou 67e8e5633e Try to fix some buildbot failures on test_ssl 2010-09-01 20:55:41 +00:00
Giampaolo Rodolà e0f9863a61 Issue #9693 - msg 115273: attempt to fix ssl module failures on certain OpenSSL versions by calling ERR_clear_error() before raising IOError 2010-09-01 19:28:49 +00:00
Giampaolo Rodolà 745ab3807e Fix issue issue9706: provides a better error handling for various SSL operations 2010-08-29 19:25:49 +00:00
Mark Dickinson 732cc9be1e Merged revisions 83677 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r83677 | mark.dickinson | 2010-08-03 19:31:54 +0100 (Tue, 03 Aug 2010) | 1 line

  Fix memory leak in ssl module.
........
2010-08-03 18:33:11 +00:00
Mark Dickinson ee55df5c85 Fix memory leak in ssl module. 2010-08-03 18:31:54 +00:00
Antoine Pitrou 4b261d2073 Merged revisions 82211 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r82211 | antoine.pitrou | 2010-06-25 02:07:34 +0200 (ven., 25 juin 2010) | 10 lines

  Merged revisions 82210 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r82210 | antoine.pitrou | 2010-06-25 02:03:21 +0200 (ven., 25 juin 2010) | 4 lines

    Issue #9075: In the ssl module, remove the setting of a `debug` flag
    on an OpenSSL structure.
  ........
................
2010-06-25 00:13:19 +00:00
Antoine Pitrou 6186bfb735 Merged revisions 82210 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82210 | antoine.pitrou | 2010-06-25 02:03:21 +0200 (ven., 25 juin 2010) | 4 lines

  Issue #9075: In the ssl module, remove the setting of a `debug` flag
  on an OpenSSL structure.
........
2010-06-25 00:07:34 +00:00
Antoine Pitrou 94fbaac58d Merged revisions 82204 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r82204 | antoine.pitrou | 2010-06-25 00:34:04 +0200 (ven., 25 juin 2010) | 5 lines

  Issue #8682: The ssl module now temporary increments the reference count of
  a socket object got through `PyWeakref_GetObject`, so as to avoid possible
  deallocation while the object is still being used.
........
2010-06-24 22:49:57 +00:00
Antoine Pitrou 8bae4ec622 Issue #8682: The ssl module now temporary increments the reference count of
a socket object got through `PyWeakref_GetObject`, so as to avoid possible
deallocation while the object is still being used.
2010-06-24 22:34:04 +00:00
Antoine Pitrou b52187710e Issue #4870: Add an `options` attribute to SSL contexts, as well as
several ``OP_*`` constants to the `ssl` module.  This allows to selectively
disable protocol versions, when used in combination with `PROTOCOL_SSLv23`.
2010-05-21 09:56:06 +00:00
Antoine Pitrou 321257da1a Merged revisions 81242 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r81242 | antoine.pitrou | 2010-05-17 01:14:22 +0200 (lun., 17 mai 2010) | 10 lines

  Merged revisions 81241 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r81241 | antoine.pitrou | 2010-05-17 01:11:46 +0200 (lun., 17 mai 2010) | 4 lines

    Clear the OpenSSL error queue each time an error is signalled.
    When the error queue is not emptied, strange things can happen on the next SSL call, depending on the OpenSSL version.
  ........
................
2010-05-16 23:18:00 +00:00
Antoine Pitrou 9d74b42aca Merged revisions 81241 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81241 | antoine.pitrou | 2010-05-17 01:11:46 +0200 (lun., 17 mai 2010) | 4 lines

  Clear the OpenSSL error queue each time an error is signalled.
  When the error queue is not emptied, strange things can happen on the next SSL call, depending on the OpenSSL version.
........
2010-05-16 23:14:22 +00:00
Victor Stinner f9faaad801 Issue #8477: ssl.RAND_egd() supports str with surrogates and bytes for the path 2010-05-16 21:36:37 +00:00
Victor Stinner 3800e1e961 Issue #8477: _ssl._test_decode_cert() supports str with surrogates and bytes
for the filename
2010-05-16 21:23:48 +00:00
Antoine Pitrou 65ec8ae47f Fix (hopefully) the remaining test_ssl buildbot failures 2010-05-16 19:56:32 +00:00
Antoine Pitrou 152efa2ae2 Issue #8550: Add first class `SSLContext` objects to the ssl module. 2010-05-16 18:19:27 +00:00
Antoine Pitrou a29b181693 Merged revisions 81116 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r81116 | antoine.pitrou | 2010-05-12 16:05:24 +0200 (mer., 12 mai 2010) | 9 lines

  Merged revisions 81115 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r81115 | antoine.pitrou | 2010-05-12 16:02:34 +0200 (mer., 12 mai 2010) | 3 lines

    Improve _ssl.c formatting
  ........
................
2010-05-12 14:08:45 +00:00
Antoine Pitrou 525807bf72 Merged revisions 81115 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81115 | antoine.pitrou | 2010-05-12 16:02:34 +0200 (mer., 12 mai 2010) | 3 lines

  Improve _ssl.c formatting
........
2010-05-12 14:05:24 +00:00
Antoine Pitrou 30dc1a73d0 Merged revisions 80790 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r80790 | antoine.pitrou | 2010-05-05 17:57:33 +0200 (mer., 05 mai 2010) | 9 lines

  Merged revisions 80789 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r80789 | antoine.pitrou | 2010-05-05 17:53:45 +0200 (mer., 05 mai 2010) | 3 lines

    Untabify Modules/_ssl.c
  ........
................
2010-05-05 16:01:14 +00:00
Antoine Pitrou cbb82ebd75 Merged revisions 80789 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80789 | antoine.pitrou | 2010-05-05 17:53:45 +0200 (mer., 05 mai 2010) | 3 lines

  Untabify Modules/_ssl.c
........
2010-05-05 15:57:33 +00:00
Antoine Pitrou 79ac78afef Merged revisions 80542 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r80542 | antoine.pitrou | 2010-04-27 21:14:15 +0200 (mar., 27 avril 2010) | 10 lines

  Merged revisions 80540 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r80540 | antoine.pitrou | 2010-04-27 21:09:59 +0200 (mar., 27 avril 2010) | 4 lines

    Issue #8549: Fix compiling the _ssl extension under AIX.  Patch by
    Sridhar Ratnakumar.
  ........
................
2010-04-27 19:18:34 +00:00
Antoine Pitrou 06e34a9476 Merged revisions 80540 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80540 | antoine.pitrou | 2010-04-27 21:09:59 +0200 (mar., 27 avril 2010) | 4 lines

  Issue #8549: Fix compiling the _ssl extension under AIX.  Patch by
  Sridhar Ratnakumar.
........
2010-04-27 19:14:15 +00:00
Antoine Pitrou ec146185c4 Merged revisions 80454 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r80454 | antoine.pitrou | 2010-04-24 23:26:44 +0200 (sam., 24 avril 2010) | 15 lines

  Merged revisions 80451-80452 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r80451 | antoine.pitrou | 2010-04-24 21:57:01 +0200 (sam., 24 avril 2010) | 4 lines

    The do_handshake() method of SSL objects now adjusts the blocking mode of
    the SSL structure if necessary (as other methods already do).
  ........
    r80452 | antoine.pitrou | 2010-04-24 22:04:58 +0200 (sam., 24 avril 2010) | 4 lines

    Issue #5103: SSL handshake would ignore the socket timeout and block
    indefinitely if the other end didn't respond.
  ........
................
2010-04-24 21:30:20 +00:00
Antoine Pitrou d3f8ab8bd3 Merged revisions 80451-80452 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80451 | antoine.pitrou | 2010-04-24 21:57:01 +0200 (sam., 24 avril 2010) | 4 lines

  The do_handshake() method of SSL objects now adjusts the blocking mode of
  the SSL structure if necessary (as other methods already do).
........
  r80452 | antoine.pitrou | 2010-04-24 22:04:58 +0200 (sam., 24 avril 2010) | 4 lines

  Issue #5103: SSL handshake would ignore the socket timeout and block
  indefinitely if the other end didn't respond.
........
2010-04-24 21:26:44 +00:00
Antoine Pitrou 5a1c4d1880 Merged revisions 80394 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r80394 | antoine.pitrou | 2010-04-23 02:16:21 +0200 (ven., 23 avril 2010) | 15 lines

  Merged revisions 80392 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r80392 | antoine.pitrou | 2010-04-23 01:33:02 +0200 (ven., 23 avril 2010) | 9 lines

    Issue #8108: Fix the unwrap() method of SSL objects when the socket has
    a non-infinite timeout.  Also make that method friendlier with applications
    wanting to continue using the socket in clear-text mode, by disabling
    OpenSSL's internal readahead.  Thanks to Darryl Miles for guidance.

    Issue #8108: test_ftplib's non-blocking SSL server now has proper handling
    of SSL shutdowns.
  ........
................
2010-04-23 21:11:10 +00:00
Antoine Pitrou 2c4f98b3c5 Merged revisions 80392 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80392 | antoine.pitrou | 2010-04-23 01:33:02 +0200 (ven., 23 avril 2010) | 9 lines

  Issue #8108: Fix the unwrap() method of SSL objects when the socket has
  a non-infinite timeout.  Also make that method friendlier with applications
  wanting to continue using the socket in clear-text mode, by disabling
  OpenSSL's internal readahead.  Thanks to Darryl Miles for guidance.

  Issue #8108: test_ftplib's non-blocking SSL server now has proper handling
  of SSL shutdowns.
........
2010-04-23 00:16:21 +00:00
Antoine Pitrou da6902cb7b Merged revisions 80317 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r80317 | antoine.pitrou | 2010-04-21 21:46:23 +0200 (mer., 21 avril 2010) | 15 lines

  Merged revisions 80314-80315 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r80314 | antoine.pitrou | 2010-04-21 21:28:03 +0200 (mer., 21 avril 2010) | 5 lines

    Issue #8484: Load all ciphers and digest algorithms when initializing
    the _ssl extension, such that verification of some SSL certificates
    doesn't fail because of an "unknown algorithm".
  ........
    r80315 | antoine.pitrou | 2010-04-21 21:36:23 +0200 (mer., 21 avril 2010) | 3 lines

    Forgot to add the sample certificate (followup to r80314)
  ........
................
2010-04-21 19:52:52 +00:00
Antoine Pitrou fec12fff0f Merged revisions 80314-80315 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80314 | antoine.pitrou | 2010-04-21 21:28:03 +0200 (mer., 21 avril 2010) | 5 lines

  Issue #8484: Load all ciphers and digest algorithms when initializing
  the _ssl extension, such that verification of some SSL certificates
  doesn't fail because of an "unknown algorithm".
........
  r80315 | antoine.pitrou | 2010-04-21 21:36:23 +0200 (mer., 21 avril 2010) | 3 lines

  Forgot to add the sample certificate (followup to r80314)
........
2010-04-21 19:46:23 +00:00
Antoine Pitrou 2d9cb9c1cb Merged revisions 80151 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80151 | antoine.pitrou | 2010-04-17 19:10:38 +0200 (sam., 17 avril 2010) | 4 lines

  Issue #8322: Add a *ciphers* argument to SSL sockets, so as to change the
  available cipher list.  Helps fix test_ssl with OpenSSL 1.0.0.
........
2010-04-17 17:40:45 +00:00
Antoine Pitrou d59ceb5b7c Merged revisions 79912 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r79912 | antoine.pitrou | 2010-04-09 22:42:09 +0200 (ven., 09 avril 2010) | 10 lines

  Merged revisions 79910 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r79910 | antoine.pitrou | 2010-04-09 22:38:39 +0200 (ven., 09 avril 2010) | 4 lines

    SSL_MODE_AUTO_RETRY has been added in OpenSSL 0.9.6.  Fix compilation
    with earlier versions.
  ........
................
2010-04-09 20:47:00 +00:00
Antoine Pitrou 0ae7b5897e Merged revisions 79910 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79910 | antoine.pitrou | 2010-04-09 22:38:39 +0200 (ven., 09 avril 2010) | 4 lines

  SSL_MODE_AUTO_RETRY has been added in OpenSSL 0.9.6.  Fix compilation
  with earlier versions.
........
2010-04-09 20:42:09 +00:00
Antoine Pitrou 04f6a32dff Merged revisions 79812 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79812 | antoine.pitrou | 2010-04-05 23:35:07 +0200 (lun., 05 avril 2010) | 5 lines

  Issue #8321: Give access to OpenSSL version numbers from the `ssl` module,
  using the new attributes `ssl.OPENSSL_VERSION`, `ssl.OPENSSL_VERSION_INFO`
  and `ssl.OPENSSL_VERSION_NUMBER`.
........
2010-04-05 21:40:07 +00:00
Antoine Pitrou ed6c893cfc Merged revisions 79449,79452 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r79449 | antoine.pitrou | 2010-03-26 20:32:24 +0100 (ven., 26 mars 2010) | 12 lines

  Merged revisions 79448 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r79448 | antoine.pitrou | 2010-03-26 20:27:16 +0100 (ven., 26 mars 2010) | 6 lines

    Issue #8222: Enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
    reads and writes are always retried by OpenSSL itself.

    (this is a followup to issue #3890)
  ........
................
  r79452 | antoine.pitrou | 2010-03-26 20:36:14 +0100 (ven., 26 mars 2010) | 3 lines

  Add NEWS entry for r79449.
................
2010-03-26 19:38:11 +00:00