#!/usr/bin/env python # -*- coding: utf-8 -*- import locale import SocketServer import BaseHTTPServer import SimpleHTTPServer import SimpleXMLRPCServer import imp import time import base64 import socket, os from OpenSSL import SSL from threading import Event, currentThread, Thread, Condition from thread import start_new_thread as start from DocXMLRPCServer import DocXMLRPCServer, DocXMLRPCRequestHandler DEFAULTKEYFILE='/etc/n4d/cert/n4dkey.pem' # Replace with your PEM formatted key file DEFAULTCERTFILE='/etc/n4d/cert/n4dcert.pem' # Replace with your PEM formatted certificate file class N4dServer(SocketServer.ThreadingMixIn,SimpleXMLRPCServer): def __init__(self,keyFile=DEFAULTKEYFILE,certFile=DEFAULTCERTFILE): self.socket = SSL.Connection(ctx, socket.socket(self.address_family, self.socket_type)) self.server_bind() self.server_activate() ctx = SSL.Context(SSL.SSLv23_METHOD) ctx.use_privatekey_file(keyFile) ctx.use_certificate_file(certFile) #def __init__ #class N4dServer if __name__=="__main__":