summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket_ssl.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix test_socket_ssl the easy way and remove it per #1489Benjamin Peterson2008-06-181-283/+0
|
* The ssl certificate at https://sf.net is not valid.Amaury Forgeot d'Arc2008-06-181-1/+1
| | | | Switch to https://sourceforge.net
* Fix typo with regards to self.PORT shadowing class variables with the same name.Trent Nelson2008-04-091-3/+3
|
* - Issue #2550: The approach used by client/server code for obtaining portsTrent Nelson2008-04-081-17/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to listen on in network-oriented tests has been refined in an effort to facilitate running multiple instances of the entire regression test suite in parallel without issue. test_support.bind_port() has been fixed such that it will always return a unique port -- which wasn't always the case with the previous implementation, especially if socket options had been set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT). The new implementation of bind_port() will actually raise an exception if it is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or SO_REUSEPORT socket option set. Furthermore, if available, bind_port() will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed. This currently only applies to Windows. This option prevents any other sockets from binding to the host/port we've bound to, thus removing the possibility of the 'non-deterministic' behaviour, as Microsoft puts it, that occurs when a second SOCK_STREAM socket binds and accepts to a host/port that's already been bound by another socket. The optional preferred port parameter to bind_port() has been removed. Under no circumstances should tests be hard coding ports! test_support.find_unused_port() has also been introduced, which will pass a temporary socket object to bind_port() in order to obtain an unused port. The temporary socket object is then closed and deleted, and the port is returned. This method should only be used for obtaining an unused port in order to pass to an external program (i.e. the -accept [port] argument to openssl's s_server mode) or as a parameter to a server-oriented class that doesn't give you direct access to the underlying socket used. Finally, test_support.HOST has been introduced, which should be used for the host argument of any relevant socket calls (i.e. bind and connect). The following tests were updated to following the new conventions: test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib, test_poplib, test_ftplib, test_telnetlib, test_socketserver, test_asynchat and test_socket_ssl. It is now possible for multiple instances of the regression test suite to run in parallel without issue.
* Suppress failure (to avoid a flaky test) if we cannot connect to svn.python.orgNeal Norwitz2008-03-231-2/+10
|
* Block the "socket.ssl() is deprecated" warning from test_socket_ssl.Jeffrey Yasskin2008-03-181-0/+6
|
* The test requires the network resourceChristian Heimes2008-02-111-0/+2
|
* Retry connection in case it fails to reduce flakinessNeal Norwitz2008-01-271-3/+30
|
* Use the host the author likely meant in the first place. pop.gmail.com isGregory P. Smith2007-10-061-4/+1
| | | | reliable. gmail.org is someones personal domain.
* Add support for asyncore server-side SSL support. This requiresBill Janssen2007-09-161-1/+1
| | | | | | | | | | | | | | | adding the 'makefile' method to ssl.SSLSocket, and importing the requisite fakefile class from socket.py, and making the appropriate changes to it to make it use the SSL connection. Added sample HTTPS server to test_ssl.py, and test that uses it. Change SSL tests to use https://svn.python.org/, instead of www.sf.net and pop.gmail.com. Added utility function to ssl module, get_server_certificate, to wrap up the several things to be done to pull a certificate from a remote server.
* More work on SSL support.Bill Janssen2007-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Much expanded test suite: All protocols tested against all other protocols. All protocols tested with all certificate options. Tests for bad key and bad cert. Test of STARTTLS functionality. Test of RAND_* functions. * Fixes for threading/malloc bug. * Issue 1065 fixed: sslsocket class renamed to SSLSocket. sslerror class renamed to SSLError. Function "wrap_socket" now used to wrap an existing socket. * Issue 1583946 finally fixed: Support for subjectAltName added. Subject name now returned as proper DN list of RDNs. * SSLError exported from socket as "sslerror". * RAND_* functions properly exported from ssl.py. * Documentation improved: Example of how to create a self-signed certificate. Better indexing.
* This contains a number of things:Bill Janssen2007-08-291-2/+2
| | | | | | | | | | | | | | | | 1) Improve the documentation of the SSL module, with a fuller explanation of certificate usage, another reference, proper formatting of this and that. 2) Fix Windows bug in ssl.py, and general bug in sslsocket.close(). Remove some unused code from ssl.py. Allow accept() to be called on sslsocket sockets. 3) Use try-except-else in import of ssl in socket.py. Deprecate use of socket.ssl(). 4) Remove use of socket.ssl() in every library module, except for test_socket_ssl.py and test_ssl.py.
* Bug #978833: Close https sockets by releasing the _ssl object.Martin v. Löwis2007-07-271-0/+19
|
* Whitespace normalization. Ugh, we really need to do this more often.Neal Norwitz2007-04-251-15/+15
| | | | You might want to review this change as it's my first time. Be gentle. :-)
* Added tests for other methods of SSL object. Now we coverFacundo Batista2007-04-221-0/+15
| | | | | all the object methods. This is the final step to close the #451607 bug.
* Typo fix.Collin Winter2007-04-101-1/+1
|
* Minor fix to the tests pass ok even with -O.Facundo Batista2007-04-101-1/+2
|
* Fixed the way that the .pem files are looked for, and changedFacundo Batista2007-04-041-16/+9
| | | | how to kill the process in win32 to use the _handle attribute.
* Changed the whole structure of startup and checking if theFacundo Batista2007-04-031-26/+36
| | | | server is available. Hope to not get more false alarms.
* Added a SSL server to test_socket_ssl.py to be able to testFacundo Batista2007-04-031-11/+80
| | | | | | locally. Now, it checks if have openssl available and run those specific tests (it starts openssl at the beggining of all the tests and then kills it at the end).
* Now using unittest for the tests infraestructure. Also split theFacundo Batista2007-04-031-111/+115
| | | | tests in those who need the network, and that who doesn't.
* Add test.test_support.transient_internet . Returns a context manager thatBrett Cannon2007-03-131-1/+1
| | | | | | | | | nests test.test_support.TransientResource context managers that capture exceptions raised when the Internet connection is flaky. Initially using in test_socket_ssl but should probably be expanded to cover any test that should not raise the captured exceptions if the Internet connection works.
* Introduce test.test_support.TransientResource. It's a context manager toBrett Cannon2007-03-081-1/+2
| | | | | | | | | | | surround calls to resources that may or may not be available. Specifying the expected exception and attributes to be raised if the resource is not available prevents overly broad catching of exceptions. This is meant to help suppress spurious failures by raising test.test_support.ResourceDenied if the exception matches. It would probably be good to go through the various network tests and surround the calls to catch connection timeouts (as done with test_socket_ssl in this commit).
* This should fix the buildbot failure on s/390 which can't connect to gmail.org.Neal Norwitz2006-06-291-6/+9
| | | | | | It makes the error message consistent and always sends to stderr. It would be much better for all the networking tests to hit only python.org.
* At the C level, tuple arguments are passed in directly to the exceptionBrett Cannon2006-06-211-4/+4
| | | | | | constructor, meaning it is treated as *args, not as a single argument. This means using the 'message' attribute won't work (until Py3K comes around), and so one must grab from 'arg' to get the error number.
* Fix typo of exception name.Brett Cannon2006-06-201-1/+1
|
* Raise TestSkipped when the test socket connection is refused.Brett Cannon2006-06-201-0/+7
|
* Fix the socket tests so they can be run concurrently. Backport candidateNeal Norwitz2006-06-121-3/+3
|
* test_timeout(): This test was added during Bug Day, but disabledTim Peters2006-04-081-20/+36
| | | | | | | | | soon after because the gmail address it connects to started timing out on all the buildbot slaves. Rewrote the test to produce a warning message (instead of failing) when the address times out. Also removed the special case for Windows -- this test started to work on Windows as soon as bug 1462352 was fixed.
* Fix stupid typo.Tim Peters2006-04-011-1/+1
|
* test_timeout(): Disable this new test on all platforms.Tim Peters2006-04-011-4/+8
| | | | | | | | | The s.connect(("gmail.org", 995)) line has been timing out on all buildbot slaves for hours now, causing the test to fail.
* Make test_socket_ssl finally pass on WInGeorg Brandl2006-03-311-0/+3
|
* Disable test_socket_ssl timeout test on Windows.Georg Brandl2006-03-311-11/+13
|
* Patch #1380952: fix SSL objects timing out on consecutive read()sGeorg Brandl2006-03-311-0/+14
|
* There was a race condition where the connector would try to connectNeal Norwitz2006-01-251-0/+3
| | | | | | | | | | before the listener was ready (on gentoo x86 buildslave). This caused the listener to not exit normally since nobody connected to it (waited in accept()). The exception was raised in the other thread and the test failed. This fix doesn't completely eliminate the race, but should make it near impossible to trigger. Hopefully it's good enough.
* test_rude_shutdown(): Rewrote to use proper threadTim Peters2006-01-241-11/+19
| | | | synchronization and termination.
* connector(): You can't use an empty string as an argument to connect()Tim Peters2003-07-011-1/+1
| | | | on Windows.
* Fix SF bug #763770, test_socket_ssl crashNeal Norwitz2003-07-011-2/+2
| | | | Don't run any tests if there is no ssl support.
* Fix SF #754870, SSL crash interpreter when remote side closes during connectNeal Norwitz2003-06-301-1/+37
| | | | Also fix a memory leak.
* Rearrange test_socket_ssl so that a skip is expected iff the networkTim Peters2002-12-041-19/+24
| | | | resource isn't enabled or the socket module doesn't support ssl.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* Whitespace normalization.Tim Peters2001-10-181-3/+0
|
* Add trivial test cases for RAND_add() and RAND_status().Jeremy Hylton2001-10-181-1/+15
| | | | (The rest of the test cases are trivial, so I don't feel too bad.)
* Skip instead of fail this test if the socket module has no sslGuido van Rossum2001-09-061-0/+3
| | | | support.
* A test of SSL support, using a roundabout method suggested by Guido.Barry Warsaw2001-08-201-0/+13
However, this is only enabled with regrtest's --use=network switch.