Package zephir :: Module certificats
[frames] | no frames]

Source Code for Module zephir.certificats

 1  # -*- coding: UTF-8 -*- 
 2  import os 
 3  from OpenSSL import SSL 
 4  from zephir.config import ROOT_DIR 
 5  from creole.cert import cert_file, key_file 
 6   
 7  ################################################# 
 8  ## Factory permettant de créer un contexte SSL ## 
 9  ################################################# 
10 -class ServerContextFactory:
11
12 - def getContext(self):
13 """Create an SSL context. 14 This is a sample implementation that loads a certificate from a file 15 called 'server.pem'.""" 16 ctx = SSL.Context(SSL.SSLv23_METHOD) 17 ctx.use_certificate_file(cert_file) 18 ctx.use_privatekey_file(key_file) 19 return ctx
20