[Commits] (heikki) Work in progress to get SSL server running in
Chandler.
commits at osafoundation.org
commits at osafoundation.org
Fri Mar 26 11:22:03 PST 2004
Commit by: heikki
Modified files:
osaf/chandler/Chandler/crypto/tests/parcels/pkitest/README.txt None 1.1
osaf/chandler/Chandler/crypto/tests/parcels/pkitest/PKITest.py 1.1 1.2
Log message:
Work in progress to get SSL server running in Chandler.
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/crypto/tests/parcels/pkitest/README.txt?rev=1.1&content-type=text/vnd.viewcvs-markup
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/crypto/tests/parcels/pkitest/PKITest.py.diff?r1=text&tr1=1.1&r2=text&tr2=1.2
Index: osaf/chandler/Chandler/crypto/tests/parcels/pkitest/PKITest.py
diff -u osaf/chandler/Chandler/crypto/tests/parcels/pkitest/PKITest.py:1.1 osaf/chandler/Chandler/crypto/tests/parcels/pkitest/PKITest.py:1.2
--- osaf/chandler/Chandler/crypto/tests/parcels/pkitest/PKITest.py:1.1 Thu Mar 25 13:04:17 2004
+++ osaf/chandler/Chandler/crypto/tests/parcels/pkitest/PKITest.py Fri Mar 26 11:21:31 2004
@@ -1,6 +1,13 @@
+from application import Globals
from OSAF.framework.blocks.ContainerBlocks import BoxContainer
from repository.parcel.Parcel import Parcel
-from M2Crypto import SSL
+from M2Crypto import SSL, Rand, threading
+from PyEGADS import egads
+import thread
+from socket import *
+# XXX
+import server3
+import client3
class PKITestViewParcel(Parcel):
@@ -18,8 +25,23 @@
class PKITestView(BoxContainer):
- def OnStartStoppServerEvent(self, notification):
- pass
+ def OnStartStopServerEvent(self, notification):
+ serverPort = Globals.repository.find('//parcels/pkitest/views/PKITestView/ServerPortText')
+ wxServerPortText = Globals.association[serverPort.getUUID( )]
+ sPort = wxServerPortText.GetValue()
+
+ threading.init()
+ Rand.load_file('randpool.dat', -1)
+ ctx = server3.setup_server_ctx()
+ sock = socket(AF_INET, SOCK_STREAM)
+ sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
+ sock.bind(('', int(sPort)))
+ sock.listen(5)
+ while 1:
+ conn, addr = sock.accept()
+ thread.start_new_thread(server3.server_thread, (ctx, conn, addr))
+ Rand.save_file('randpool.dat')
+ threading.cleanup()
def OnConnectDisconnectClientEvent(self, notification):
pass
More information about the Commits
mailing list