Issue48

Title Test PyOpenSSL under Windows
Type bug Status chatting
Importance 75.0
Superseder Nosy List mg, mk, t.toft, tpj
Assigned To Keywords simple

Created on 2008-07-25.18:20:04 by mg, last changed 2008-10-06.20:00:41 by mg.

Files
File name Uploaded Type Edit Remove
testmillionaires.bat mk, 2008-10-01.18:28:47 application/octet-stream
Messages
msg258 (view) Author: mg Date: 2008-10-06.20:00:41
As I understood if from Mikkel, then even the simple echoserver_ssl
example from Twisted fails with his version of pyOpenSSL -- correct?

If so, could you please report it to the Twisted mailing list:

  http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

It would be cool if we could include a fix for along with the fix for
the multiplication with "weird" thresholds.
msg256 (view) Author: mk Date: 2008-10-02.11:30:51
Are you guys ready for the fun part?

I tested with the latest of everything now on XP and Vista (including
0.9.8i and not g) and...

It works exactly like it does for Thomas on XP but crashes before
finishing on Vista.
msg253 (view) Author: mg Date: 2008-10-02.10:10:03
> Mikkel Krøigård <mk@daimi.au.dk> added the comment:
>
> I take great pride in my spaghetti coding skills. But hey, it works
> doesn't it :)

I don't know -- my browser suggested that I opened the file using
wine-safe, but I declined...

> Well let me put it this way: After following our installation
> instructions, people probably want to do a quick sanity check on
> their installation. I'm not saying it should take exactly this form,
> but anything is better than opening n windows on your own and then
> forgetting to generate certificates.

Definitely! Issue 15 describes this idea as well.
msg251 (view) Author: mk Date: 2008-10-02.02:20:03
I take great pride in my spaghetti coding skills. But hey, it works doesn't it
:)

Well let me put it this way: After following our installation instructions,
people probably want to do a quick sanity check on their installation. I'm not
saying it should take exactly this form, but anything is better than opening n
windows on your own and then forgetting to generate certificates.

As for the bug itself, it's getting a little late, but tomorrow I will test it
on Windows XP as well to see if I get what Thomas sees. I'm guessing that
either there really is a difference between how it works in Vista and XP or
something went wrong when I tried to test with earlier versions of OpenSSL than
0.9.8i (I used that version first).

There's something fishy about the Vista installation of OpenSSL - it does not
uninstall properly and another version cannot be installed unless if you enter
safe mode and remove some dlls yourself. I am pretty sure I got it right, but
I'm going to try again just in case :)
msg249 (view) Author: mg Date: 2008-10-01.23:00:04
Wow, with those .bat file programming skillz, you're definitely a
Windows-guy! I can hardly parse it... :-)

Should we include such a guy in the repository? Having .bat and .sh
scripts would be nice -- we can then generalize it to a .py launcher
later.
msg248 (view) Author: tpj Date: 2008-10-01.21:31:24
I keep getting the exception at the very end, after the computation
has finished. This is the case both when I run millionaires.py and the
echoserv_ssl.py/echoclient_ssl.py example.

The problem seems to occur only when I use SSL. My setup is

WinXP Pro SP3
Python 2.5.1
OpenSSL 0.9.8g
PyOpenSSL 0.7
Twisted 8.1.0
msg247 (view) Author: mk Date: 2008-10-01.18:28:47
Still no luck here. Thomas I am very interested in which versions you
are using of well... everything. My python still crashes the moment
player 2 tries to talk to player 3. Note that everything works if I
turn off SSL.

Also I made a neat litle batch file that sets up everything for the
millionaires example, runs it in 3 windows and KEEPS THEM OPEN (stupid
console windows :) ). The last part is why it looks a bit weird.
msg246 (view) Author: mk Date: 2008-10-01.15:49:47
OK, I have tested the echo server, and I get the following output from
the client:

------------------------------

D:\>python echoclient_ssl.py
receive: Hello, world!
receive: What a fine day it is.
receive: Bye-bye!
connection lost (protocol)
connection lost: Connection to the other side was lost in a non-clean
fashion.

D:\>

------------------------------

In other words, it would seem that it does indeed finish here, but as
with Thomas it reports a non-clean loss of connection. There has got
to be something odd going on here. Probably something really obvious
that we have all somehow missed.

Oh yeah, and I am not a "Windows-guy", I am just not very religious
when it comes to these things :)
msg238 (view) Author: mg Date: 2008-09-30.18:40:03
Thanks Mikkel for testing it.

I suggest that you (or some other Windows-guy) make a small example
program using pyOpenSSL and see if you can make that work.

Then try with an example Twisted program using OpenSSL. There is an
example client and server here:

http://twistedmatrix.com/trac/browser/trunk/doc/core/examples/echoserv_ssl.py
http://twistedmatrix.com/trac/browser/trunk/doc/core/examples/echoclient_ssl.py
msg236 (view) Author: mk Date: 2008-09-30.18:13:36
I just tested this on Vista and I get the (same) unclean connection
messages before the millionaries program actually terminates. Then
python crashes.
msg234 (view) Author: mg Date: 2008-09-26.22:11:13
Did nobody read this?
msg216 (view) Author: mg Date: 2008-09-23.17:53:10
Can you all reproduce this under windows?
msg192 (view) Author: mg Date: 2008-09-18.21:34:02
Is any of you Windows guys investigating this?
msg187 (view) Author: tpj Date: 2008-09-12.01:18:46
>And, of course, it would still be nice if somebody tested it on
>Windows Vista.

By the way, it would be nice if things like this were not to be tested
manually. Rather, someone should write an automated test for the
BuildBot that reveals whether VIFF works with SSL.
msg172 (view) Author: mg Date: 2008-08-27.02:43:58
Excellent, thanks for testing this! Now we just need to find out why
the connection is lost when everything else seems to work...
msg170 (view) Author: tpj Date: 2008-08-26.23:52:46
I'm changing the status of this issue from 'urgent' to 'bug' since the
millionaires example works for me on WinXP. The only problem now is
the annoying Twisted message I get, saying that the connection was
lost in an unclean way.

And, of course, it would still be nice if somebody tested it on
Windows Vista.
msg167 (view) Author: tpj Date: 2008-08-26.23:28:00
A-ha! I forgot to run the generate-certificates.py. Silly me! Now it
works, but all three millionaires get a Twisted failure like this:

C:\temp\viff-ff249565fa3a\apps>python millionaires.py player-3.ini
Seeding random generator with random seed 3845
Using SSL
Listening on port 9003
I am Millionaire 3 and I am worth 101 millions.
From poorest to richest:
  Millionaire 2
  Millionaire 1
  Millionaire 3 (101 millions)
Synchronizing shutdown...  done.
Closing connections... Traceback (most recent call last):
Failure: twisted.internet.error.ConnectionLost: Connection to the
other side was lost in a non-clean fashion.
Traceback (most recent call last):
Failure: twisted.internet.error.ConnectionLost: Connection to the
other side was lost in a non-clean fashion.
msg166 (view) Author: tpj Date: 2008-08-26.22:10:03
When trying to run the millionaires example on Windows with the new
OpenSSL I get the following exception:

C:\temp\viff-ff249565fa3a\apps>python millionaires.py player-3.ini
Seeding random generator with random seed 9235
Using SSL
Traceback (most recent call last):
  File "millionaires.py", line 150, in <module>
    pre_runtime = create_runtime(id, players, 1, options, Toft05Runtime)
  File "C:\Python25\Lib\site-packages\viff\runtime.py", line 1619, in
create_runtime
    ctx_factory = SSLContextFactory(id)
  File "C:\Python25\Lib\site-packages\viff\runtime.py", line 1607, in __init__
    ctx.use_certificate_file('player-%d.cert' % id)
OpenSSL.SSL.Error: [('system library', 'fopen', 'No such file or
directory'), ('BIO routines', 'FILE_CTRL', 'system lib'), ('SSL
routines', 'SSL_CTX_use_certificate_file', 'system lib')]

Have any of you come across something like this on the other platforms?
msg144 (view) Author: mg Date: 2008-07-28.10:35:17
Mikkel, Tomas, and Thomas: I think you guys use Windows, so could one
of you please test PyOpenSSL?
msg134 (view) Author: mg Date: 2008-07-25.18:20:04
As far as I know nobody has tested the SSL functionality of VIFF since
we switched to PyOpenSSL almost two weeks ago (rev facc9f1f0bb1).
Please test it and close this bug if it works.
History
Date User Action Args
2008-10-06 20:00:41mgsetmessages: + msg258
2008-10-02 11:30:51mksetmessages: + msg256
2008-10-02 10:10:03mgsetmessages: + msg253
2008-10-02 02:20:03mksetmessages: + msg251
2008-10-01 23:00:04mgsetmessages: + msg249
2008-10-01 21:31:24tpjsetmessages: + msg248
2008-10-01 18:28:47mksetfiles: + testmillionaires.bat
messages: + msg247
2008-10-01 15:49:47mksetmessages: + msg246
2008-09-30 18:40:03mgsetmessages: + msg238
2008-09-30 18:13:36mksetmessages: + msg236
2008-09-26 22:11:13mgsetmessages: + msg234
2008-09-23 17:53:16mgsetimportance: 75.0
2008-09-23 17:53:10mgsetmessages: + msg216
2008-09-23 16:16:11tpjsettype: bug
2008-09-18 21:34:02mgsetmessages: + msg192
2008-09-12 01:18:46tpjsetmessages: + msg187
2008-08-27 02:43:58mgsetmessages: + msg172
2008-08-26 23:52:46tpjsetpriority: 2
messages: + msg170
2008-08-26 23:28:00tpjsetmessages: + msg167
2008-08-26 22:10:03tpjsetmessages: + msg166
2008-07-30 19:00:46mgsetkeyword: + simple
2008-07-28 10:35:17mgsetpriority: None
nosy: + mk, t.toft, tpj
status: unread -> chatting
messages: + msg144
2008-07-25 18:20:04mgcreate
Note:
The indicated property no longer exists