|
@@ -50,11 +50,24 @@ class ReceiverThread(threading.Thread):
|
|
|
class Euroscope:
|
|
|
# @brief Initializes the ZMQ socket
|
|
|
# @param[in] config The server configuration
|
|
|
- def __init__(self, config : Server.Server):
|
|
|
+ def __init__(self, configPath : str, config : Server.Server):
|
|
|
self.context = zmq.Context()
|
|
|
|
|
|
+ # find the key directories
|
|
|
+ serverKeyPath = os.path.join(os.path.join(configPath, 'keys'), 'server')
|
|
|
+ if False == os.path.isdir(serverKeyPath):
|
|
|
+ sys.stderr.write('No directory for the server key found')
|
|
|
+ sys.exit(-1)
|
|
|
+ print('Path to the server key: ' + serverKeyPath)
|
|
|
+
|
|
|
+ clientKeyPath = os.path.join(os.path.join(configPath, 'keys'), 'clients')
|
|
|
+ if False == os.path.isdir(clientKeyPath):
|
|
|
+ sys.stderr.write('No directory for the client keys found')
|
|
|
+ sys.exit(-1)
|
|
|
+ print('Path to the client keys: ' + clientKeyPath)
|
|
|
+
|
|
|
# read the certificates
|
|
|
- keyPairPath = glob.glob(os.path.join(config.ServerKeyPath, '*.key_secret'))
|
|
|
+ keyPairPath = glob.glob(os.path.join(serverKeyPath, '*.key_secret'))
|
|
|
if 1 != len(keyPairPath):
|
|
|
sys.stderr.write('No public-private keypair found for the server certificate')
|
|
|
sys.exit(-1)
|