Search This Blog

Wednesday, August 21, 2013

3ds Max 2014 Extension: Python and SSL connection hangs

While working on MaxPlus Python testers found a hang in SSL connections.  It turns out that there is a defect with OpenSSL and Python 2.7.3 that causes a long delay when using SSL operations.  I rebuilt OpenSSL against Python 2.7.3 and then rebuilding the Python 2.7.3 _ssl.pyd with the rebuilt OpenSSL fixes the issue.  There are no source code changes to OpenSSL or Python, just straight re-compiles.

To install unzip the three files into the <3dsmax root>\Python\DLLs folder.  You might want to rename the original _ssl.pyd to _ssl.pyd.bak.

Sample SSL test code:

import ssl
import time

timeStart = time.time()
print "[%s] Prepping ssl" % timeStart

ssl.RAND_status()
timeEnd = time.time()
print "[%s] Done prepping ssl" % timeEnd

timeTotal = timeEnd - timeStart
print 'Total Time: %.2f seconds' % timeTotal

1 comment: