mirror of
https://github.com/moparisthebest/HttpUploadComponent
synced 2024-11-28 03:42:15 -05:00
optional ssl support (recommended)
This commit is contained in:
parent
c09664797d
commit
8bd4ad6803
@ -9,6 +9,7 @@ import string
|
|||||||
import hashlib
|
import hashlib
|
||||||
import random
|
import random
|
||||||
import os
|
import os
|
||||||
|
import ssl
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
try:
|
try:
|
||||||
@ -172,6 +173,8 @@ if __name__ == "__main__":
|
|||||||
logging.basicConfig(level=logging.DEBUG,
|
logging.basicConfig(level=logging.DEBUG,
|
||||||
format='%(levelname)-8s %(message)s')
|
format='%(levelname)-8s %(message)s')
|
||||||
server = ThreadedHTTPServer(('0.0.0.0', config['http_port']), HttpHandler)
|
server = ThreadedHTTPServer(('0.0.0.0', config['http_port']), HttpHandler)
|
||||||
|
if 'keyfile' in config and 'certfile' in config:
|
||||||
|
server.socket = ssl.wrap_socket(server.socket, keyfile=config['keyfile'], certfile=config['certfile'])
|
||||||
xmpp = MissingComponent(config['jid'],config['secret'])
|
xmpp = MissingComponent(config['jid'],config['secret'])
|
||||||
if xmpp.connect():
|
if xmpp.connect():
|
||||||
xmpp.process()
|
xmpp.process()
|
||||||
|
Loading…
Reference in New Issue
Block a user