2014-12-02 12:54:01 +01:00
|
|
|
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
|
|
|
|
# this repository contains the full copyright notices and license terms.
|
2014-09-03 23:32:01 +02:00
|
|
|
from trytond.config import config
|
2009-02-11 20:37:24 +01:00
|
|
|
|
|
|
|
|
|
2012-12-13 19:04:52 +01:00
|
|
|
def SSLSocket(socket):
|
|
|
|
|
# Let the import error raise only when used
|
|
|
|
|
import ssl
|
|
|
|
|
return ssl.wrap_socket(socket,
|
|
|
|
|
server_side=True,
|
2014-09-03 23:32:01 +02:00
|
|
|
certfile=config.get('ssl', 'certificate'),
|
|
|
|
|
keyfile=config.get('ssl', 'privatekey'),
|
2012-12-13 19:04:52 +01:00
|
|
|
ssl_version=ssl.PROTOCOL_SSLv23)
|