예제 #1
0
def getCAPublicKey():
    lines = []
    ignore = False
    with open(settings.get_ssl_ca_filename()) as key:
        for line in key:
            if "PRIVATE" in line:
                ignore = not ignore
            elif not ignore:
                lines.append(line)
    return "".join(lines)
예제 #2
0
파일: misc.py 프로젝트: GLab/ToMaTo
def getCAPublicKey():
	lines = []
	ignore = False
	with open(settings.get_ssl_ca_filename()) as key:
		for line in key:
			if "PRIVATE" in line:
				ignore = not ignore
			elif not ignore:
				lines.append(line)
	return "".join(lines)
예제 #3
0
파일: rpcserver.py 프로젝트: GLab/ToMaTo
def start():
	global server
	print >>sys.stderr, "Starting RPC server..."
	def wrapError(error, method, args, kwargs):
		error = handleError(error, method, args, kwargs)
		return sslrpc2.Failure(error.raw)
	for config in settings.get_own_interface_config():
		server = sslrpc2.Server(('0.0.0.0', config['port']), beforeExecute=logCall, onError=wrapError, keyfile=settings.get_ssl_key_filename(),
							certfile=settings.get_ssl_cert_filename(), ca_certs=settings.get_ssl_ca_filename(), cert_reqs=ssl.CERT_REQUIRED)
		server.registerContainer(api)
		util.start_thread(server.serve_forever)
		print >>sys.stderr, "done."
예제 #4
0
def start():
    global server
    print >> sys.stderr, "Starting RPC server..."

    def wrapError(error, method, args, kwargs):
        error = handleError(error, method, args, kwargs)
        return sslrpc2.Failure(error.raw)

    for config in settings.get_own_interface_config():
        server = sslrpc2.Server(('0.0.0.0', config['port']),
                                beforeExecute=logCall,
                                onError=wrapError,
                                keyfile=settings.get_ssl_key_filename(),
                                certfile=settings.get_ssl_cert_filename(),
                                ca_certs=settings.get_ssl_ca_filename(),
                                cert_reqs=ssl.CERT_REQUIRED)
        server.registerContainer(api)
        util.start_thread(server.serve_forever)
        print >> sys.stderr, "done."